i got seriously problem with page speed.

Discussion in 'Programming' started by suwandichen13, Feb 16, 2012.

  1. #1
    hello. i want to use gzip for my web. so i am start to searching google. then 2 code.

    1 > what must i do with this code?where i must put it???
    gzip-css.php
    <?php
    ob_start ("ob_gzhandler");
    header("Content-type: text/css; charset: UTF-8");
    header("Cache-Control: must-revalidate");
    $offset = 60 * 60 ;
    $ExpStr = "Expires: " .
    gmdate("D, d M Y H:i:s",
    time() + $offset) . " GMT";
    header($ExpStr);
    ?>

    then htaccess addons

    HTACCESS ADDON <<< where must i put??

    AddHandler application/x-httpd-php .css
    php_value auto_prepend_file gzip-css.php
    php_flag zlib.output_compression On

    any one can helping me out from my problem??
    thanks
     
    suwandichen13, Feb 16, 2012 IP
  2. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #2
    have you tried anything yet? first try, if it fails ask! :)
     
    EricBruggema, Feb 18, 2012 IP
  3. suwandichen13

    suwandichen13 Well-Known Member

    Messages:
    618
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    140
    #3
    i already try it. but syntax error. 403 error. so do you have a clue where i must put that code? can you gimme example?? Thanks Eric
     
    suwandichen13, Feb 19, 2012 IP
  4. Ultrabooked

    Ultrabooked Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You must put it in your .htaccess file.
     
    Ultrabooked, Feb 23, 2012 IP
  5. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #5
    The PHP code (the first block) must be in the PHP file for the page. The htaccess code must be in the .htaccess file.

    But if you have to ask these questions, I don't think you're going to be able to fix things yourself. Sorry, but it's not as simple as you want it to be. (And your site may already be using gzip, so that may not be the reason it's slow. Without even a link to the site, there's no way we can even make a wild guess as to what the problem is.)
     
    Rukbat, Feb 25, 2012 IP
  6. balavalli

    balavalli Guest

    Messages:
    45
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #6
    configure your .htaccess file
     
    balavalli, Mar 6, 2012 IP