Browser caching not enabling for javascript/media

Hi Guys,

I'm trying to get Hummingbird, well, humming, and I'm stuck on browser caching: Javascript and Media.

This is the code in my .htaccess:

ExpiresActive on
ExpiresByType text/css "access plus 8 days"
ExpiresByType text/xml "access plus 8 days"
ExpiresByType text/javascript "access plus 8 days"
ExpiresByType application/x-javascript "access plus 8 days"
ExpiresByType image/ico "access plus 8 days"
ExpiresByType image/jpg "access plus 8 days"
ExpiresByType image/jpeg "access plus 8 days"
ExpiresByType image/gif "access plus 8 days"
ExpiresByType image/png "access plus 8 days"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType text/html "access plus 8 days"
ExpiresByType video/ogg "access plus 1 month"
ExpiresByType audio/ogg "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType video/webm "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType application/json "access plus 0 seconds"
ExpiresByType application/rss+xml "access plus 1 hour"
ExpiresByType application/atom+xml "access plus 1 hour"

This was created by Site Ground support staff. Any tweaks greatly appreciated!

  • Kasia Swiderska

    Hello Shannon,

    Have you tried htaccess code that Hummingbird provides?

    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault A0
    
    <FilesMatch "\.(txt|xml|js)$">
    ExpiresDefault A691200
    </FilesMatch>
    
    <FilesMatch "\.(css)$">
    ExpiresDefault A691200
    </FilesMatch>
    
    <FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|mp4|m4v|ogg|webm|aac)$">
    ExpiresDefault A691200
    </FilesMatch>
    
    <FilesMatch "\.(jpg|jpeg|png|gif|swf|webp)$">
    ExpiresDefault A691200
    </FilesMatch>
    </IfModule>
    
    <IfModule mod_headers.c>
      <FilesMatch "\.(txt|xml|js)$">
       Header set Cache-Control "max-age=691200"
      </FilesMatch>
    
      <FilesMatch "\.(css)$">
       Header set Cache-Control "max-age=691200"
      </FilesMatch>
    
      <FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|mp4|m4v|ogg|webm|aac)$">
       Header set Cache-Control "max-age=691200"
      </FilesMatch>
    
      <FilesMatch "\.(jpg|jpeg|png|gif|swf|webp)$">
       Header set Cache-Control "max-age=691200"
      </FilesMatch>
    </IfModule>

    I'm using this on my SiteGround hosting and it works fine for my sites there.
    Can you try this one instead of one you have now?

    kind regards,
    Kasia

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.