1

I analyzed my website on Gtmetrix.com for optimization and the result was this:

There are 4 static components without a far-future expiration date:

http://www.someextensionsite.com/widgets/v1.0/init.js
http://static.someextensionsite.com/templates.0p4D3v0p5f.js
http://static.someextensionsite.com/styles.0p4D3v0p5f.css
http://static.someextentionsite.com/preload_data.0p4D3v0p5f.js

Expires headers let the browser know whether to server a cached version of the page.

and i should add this: someextentionsite is a search extentin.

how to solve this problem?

3

You don't control the domains

  • www.someextensionsite.com
  • static.someextensionsites.com

therefore you can't do anything to fix this error.

13

Try to put this in .htaccess

<ifModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 2 days"
    ExpiresByType image/x-icon "access plus 2592000 seconds"
    ExpiresByType text/html "access plus 1 seconds"
    ExpiresByType image/gif "access plus 2592000 seconds"
    ExpiresByType image/jpeg "access plus 2592000 seconds"
    ExpiresByType image/jpg "access plus 2592000 seconds"
    ExpiresByType image/png "access plus 2592000 seconds"
    ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
    ExpiresByType text/css "access plus 604800 seconds"
    ExpiresByType text/javascript "access plus 216000 seconds"
    ExpiresByType application/javascript "access plus 216000 seconds"
    ExpiresByType application/x-javascript "access plus 216000 seconds"
    ExpiresByType application/xhtml+xml "access plus 600 seconds"
</ifModule> 
  • 1
    Only difference for me from this post was a small tweak for the favicon AddType image/x-icon .ico – quickshiftin Jun 5 '15 at 18:29
  • 1
    The default htaccess already containsExpiresDefault "access plus 1 year", what is missing is ExpiresActive On - if that's not on by default – Fabian Schmengler Sep 26 '16 at 8:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.