Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Apache Header Cache Control
 
mkos
Member
 
Avatar
Total Posts:  60
Joined:  2009-12-03
Florida
 

Last week I was optimizing my configuration of Apache to decrease the page load times of my sites.  I thought Header Cache Control in Apache would be useful to help speed things up so I tried the following in my httpd.conf file:

<IfModule mod_cache.c>
         
CacheDisable "/index.php/admin"
            
CacheDisable "/admin"
        
CacheDisable "/index.php/checkout"
        
CacheDisable "index.php/customer"
        
CacheDisable "/index.php/contacts"
        
CacheDisable "/index.php/wishlist"
     
<IfModule mod_disk_cache.c>
         
CacheDefaultExpire 3600
         CacheEnable disk 
/
         
CacheRoot "/var/cache/apache/"
         
CacheDirLevels 5
         CacheDirLength 1
        CacheLock on
        CacheLockPath 
/tmp/mod_cache-lock
        CacheLockMaxAge 5         
        CacheMaxFileSize 1000000
         CacheMinFileSize 1
         CacheIgnoreCacheControl Off
         CacheIgnoreNoLastMod On
         CacheIgnoreQueryString Off
         CacheIgnoreHeaders None
         CacheLastModifiedFactor 0.1
         CacheDefaultExpire 3600
         CacheMaxExpire 86400
         CacheStoreNoStore Off
         CacheStorePrivate On
     
</IfModule>
     </
IfModule>
     <
IfModule mod_headers.c>
         
ExpiresActive On
            Header 
unset Pragma
         FileETag None
        Header 
unset ETag
        
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf|mp3|mp4)$">
            
Header set Cache-Control "public, no-transform"
            
Header set Expires A1209600
            Header 
unset Last-Modified
        
</FilesMatch>
     </
IfModule>
     </
IfModule>
        
ExpiresByType text/css "now plus 1 month"
        
ExpiresByType application/x-javascript "now plus 1 month"
<IfModule mod_cache.c>

The front end was loading in less than .5 seconds!  Unfortunately, the Admin panel was also being cached in the browser, rendering it pretty much useless.  I ended up having to take all of the Header Cache Control out, clear my browser cache and restart the server to get the Admin Panel back to normal.  Has anyone been successful at implementing Apache Header Cache Control without it impacting the Admin Panel?

 
Magento Community Magento Community
Magento Community
Magento Community
 
andy11
Jr. Member
 
Total Posts:  4
Joined:  2010-07-06
 

Hey did you get anywhere with this? im experimenting with it at the moment

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top