SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard dethfire's Avatar
    Join Date
    Aug 2000
    Posts
    2,477
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    htaccess - pagespeed cache exp problem

    I have this in my htaccess which is in my root www folder.

    Code:
    # Turn on Expires and set default to 0
    ExpiresActive On
    ExpiresDefault A0
    
    # Set up caching on media files for 1 year (forever?)
    <FilesMatch "\.(ico|flv|pdf|mov|mp3|wmv|ppt)$">
    ExpiresDefault A29030400
    Header append Cache-Control "public"
    </FilesMatch>
    
    # Set up caching on media files for 1 week
    <FilesMatch "\.(gif|jpg|jpeg|png|swf|js)$">
    ExpiresDefault A604800
    Header append Cache-Control "public, proxy-revalidate"
    </FilesMatch>
    
    # Set up 2 Hour caching on commonly updated files
    <FilesMatch "\.(xml|txt|html|css|rss)$">
    ExpiresDefault A7200
    Header append Cache-Control "private, proxy-revalidate, must-revalidate"
    </FilesMatch>
    
    # Force no caching for dynamic files
    <FilesMatch "\.(php|cgi|pl|htm)$">
    ExpiresDefault A0
    Header set Cache-Control "no-cache, no-store, must-revalidate, max-age=0, proxy-revalidate, no-transform"
    Header set Pragma "no-cache"
    </FilesMatch>
    If I check my main page http://www.physicsforums.com with pagespeed it says almost all my items are cached. Good! However if I check a page link http://www.physicsforums.com/forumdisplay.php?f=149 then it says none are cache. What am I doing wrong? thanks!
    Free Science Homework Help
    http://www.physicsforums.com

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,644
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    Isn't forumdisplay.php a dynamic file? Not knowing how your cache works, I suspect that it has something to do with this (as the script asking for the "supporting files").

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  3. #3
    SitePoint Wizard dethfire's Avatar
    Join Date
    Aug 2000
    Posts
    2,477
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dklynn View Post
    Isn't forumdisplay.php a dynamic file? Not knowing how your cache works, I suspect that it has something to do with this (as the script asking for the "supporting files").

    Regards,

    DK
    right the php file itself is no cache and that is fine, but all the images and css end up without a cache exp too
    Free Science Homework Help
    http://www.physicsforums.com


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •