Announcement

Collapse
No announcement yet.

Add Expires headers to files served my Miva

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Add Expires headers to files served my Miva

    I have tried to implement the following snippet to a .htaccess file
    <IfModule mod_expires.c>
    # Turn on Expires and set default to 0
    ExpiresActive On
    ExpiresDefault A0


    # Set up caching on media files for 1 week
    <FilesMatch "\.(gif|jpg|jpeg|png|swf)$">
    ExpiresDefault A604800
    Header append Cache-Control "public"
    </FilesMatch>

    # Set up 2 Hour caching on commonly updated files
    <FilesMatch "\.(xml|txt|html|js|css)$">
    ExpiresDefault A7200
    Header append Cache-Control "proxy-revalidate"
    </FilesMatch>

    # Force no caching for dynamic files
    <FilesMatch "\.(php|cgi|pl|htm)$">
    ExpiresActive Off
    Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
    Header set Pragma "no-cache"
    </FilesMatch>
    </IfModule>

    but I notice that since the files img, js, css, etc reside in Miva Merchant (YSLOW and Page Speed) do not indicate an expires header. Do I need to move css background images, js and css out of miva in order for this to work?
Working...
X