The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Php script lag

Discussion in 'General Discussion' started by wonker, Mar 5, 2009.

  1. wonker

    wonker Active Member

    Joined:
    Dec 5, 2007
    Messages:
    29
    Likes Received:
    2
    Trophy Points:
    3
    Hello, I've been trying to find an answer to this one for quite some time now... I don't know if this is the best place to ask but here goes...

    I've got the latest cpanel release running on centos.

    I'm using apache 2.2 and PHP 5.2.9 installed by whm with default settings

    When I run the following code the browser with a javascript or css file it waits about 5 secs before loading the page :
    PHP:
    <?php
    header
    ('Content-Type: application/x-javascript');
    header('Content-Length: '.filesize('test.js'));
    readfile('test.js');
    ?>
    But if I do it with an image or if I don't specify the content type I don't get a lag.

    I was wandering about a gzip compression problem but I've set zlib.output_compression to 1 (instead of default value of 6) and I still have the same lag.

    If someone has come accross the same problem I would be very gratefull for a helping hand ...

    Thankyou.
     
  2. wonker

    wonker Active Member

    Joined:
    Dec 5, 2007
    Messages:
    29
    Likes Received:
    2
    Trophy Points:
    3
    A bit of news:

    I've just tried without the Content-Length line and no more lag...

    <?php
    header('Content-Type: application/x-javascript');
    //header('Content-Length: '.filesize('test.js'));
    readfile('test.js');
    ?>

    Any suggestions about what is wrong ? is it something to do with gzip?
     
Loading...

Share This Page