So, i enabled mod expires to my web page. Here's the code i used:

<IfModule mod_expires.c>
        ExpiresDefault "access plus 2 months" 
        ExpiresByType image/x-icon "access plus 1 month"
        ExpiresByType image/png "access plus 1 month"
        ExpiresByType image/jpg "access plus 1 month"
        ExpiresByType image/gif "access plus 1 month"
        ExpiresByType image/jpeg "access plus 1 month"
        ExpiresByType application/pdf "access plus 1 month"
        ExpiresByType audio/x-wav "access plus 1 month"
        ExpiresByType audio/mpeg "access plus 1 month"
        ExpiresByType video/mpeg "access plus 1 month"
        ExpiresByType video/mp4 "access plus 1 month"
        ExpiresByType video/quicktime "access plus 1 month"
        ExpiresByType video/x-ms-wmv "access plus 1 month"
        ExpiresByType application/x-shockwave-flash "access 1 month" 
        ExpiresByType text/css "access plus 1 hour"
        ExpiresByType text/javascript "access plus 1 hour"     
</IfModule>

The site got super fast, however, i could not get it to change anymore unless i disable the mod. The page content almost didn't change, and the most important part - the session variables did not also. I could not destroy them, and therefore the log out function for users did not work at all. How to use this mod to improve page speed without affecting HTML content and session variables (i want it to cache images and other content that does not change often)?

Thanks

Also, remove ExpiresDefault "access plus 2 months" which will try to cache everything and not only the mimes declared below in the list. And add ExpiresActive On at the top because it is required by ExpiresByType:

Note that this directive only has effect if ExpiresActive On has been specified

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.