PHP Syntax (Toggle Plain Text)
  1. <?php
  2. ———–CSS——————————————————
  3. ob_start (“ob_gzhandler”);
  4. header (“content-type: text/css; charset: UTF-8”);
  5. header (“cache-control: must-revalidate”);
  6. $offset = 48 * 60 * 60;
  7. $expire = “expires: ” . gmdate (“D, d M Y H:i:s”, time() + $offset) . ” GMT”;
  8. header ($expire);
  9. ?>
  10. ———-PHP——————————————————
  11. <?php
  12. if (substr_count($_SERVER[‘HTTP_ACCEPT_ENCODING’], ‘gzip’))
  13. ob_start(“ob_gzhandler”);
  14. else
  15. ob_start();
  16. header (“content-type: text/html; charset: UTF-8”);
  17. header (“cache-control: must-revalidate”);
  18. echo $offset = 48 * 60 * 60;
  19. $expire = “expires: ” . gmdate (“D, d M Y H:i:s”, time() + $offset) . ” GMT”;
  20. header ($expire);
  21. ?>
    1. <IfModule mod_expires.c>
    2. ExpiresActive On
    3. ExpiresByType image/gif A2592000
    4. ExpiresByType image/jpg A2592000
    5. ExpiresByType image/png A2592000
    6. ExpiresByType application/x-javascript A2592000
    7. ExpiresByType text/css A2592000
    8. ExpiresByType image/x-icon A2592000
    9. </IfModule>