3

I'm using this code in .htaccess

<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType text/html "access plus 3 days"
ExpiresByType text/xml "access plus 1 seconds"
ExpiresByType text/plain "access plus 1 seconds"
ExpiresByType application/xml "access plus 1 seconds"
ExpiresByType application/rss+xml "access plus 1 seconds"
ExpiresByType application/json "access plus 1 seconds"
ExpiresByType text/css "access plus 1 week"
ExpiresByType text/javascript "access plus 1 week"
ExpiresByType application/javascript "access plus 1 week"
ExpiresByType application/x-javascript "access plus 1 week"
ExpiresByType image/x-ico "access plus 1 year"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType application/pdf "access plus 1 month"
<IfModule mod_headers.c>
   Header unset ETag
   Header unset Pragma
   Header unset Last-Modified
   Header append Cache-Control "public, no-transform, must-revalidate"
   Header set Last-modified "Tue, 1 Aug 2016 10:10:10 GMT"
 </IfModule>
 </IfModule>

But gtmetrix.com and tools.pingdom.com shows 5 static components without a far-future expiration date.

http://fonts.googleapis.com/css?family=Lato:900
http://fonts.googleapis.com/css?family=Merriweather:regular,700
http://www.google-analytics.com/analytics.js
http://www.statcounter.com/counter/counter.js
http://c.statcounter.com/t.php?sc_project=11059157&java=1&security=2d5e45b2&u1=D82D61ABF18A4FF9620A96B3F31C97F5&sc_random=0.5705474616082253&jg=new&rr=1.1.1.1.1.1.1.1.1&resolution=1024&h=861&camefrom=&u=http%3A//hddregenerator.net/&t=HDD%20REGENERATOR.%2015%25%20Discount%20%7C%20HDD%20Regenerator%20for%20%2484.99.%20Free%20Demo%20download.%2030-day%20money%20back%20guarantee.%20Free%201%20year%20minor%20update.%20Unlimited%20license%20period.&rcat=d&rdom=d&rdomg=new&bb=1&sc_snum=1&sess=a181b5&p=0&invisible=1

How to add expire headers for these 5 components?!

5
  • 1
    you can use one of the plugin for same W3 Total Cache WP Super Cache WP Rocket Commented Aug 1, 2016 at 7:43
  • I use the total cash but get the message about the expires header anyway. Commented Aug 1, 2016 at 7:57
  • try to install WP Super Cache Commented Aug 1, 2016 at 7:59
  • Hello @Merkucio, I am facing the same issue. Did you find a solution for this? I am already using the WP Super Cache plugin. Commented Oct 19, 2018 at 9:49
  • Hello. No, I didn't. Commented Oct 23, 2018 at 11:38

1 Answer 1

1

I believe you can't add expire headers to those 5 components, simply because they aren't on your own server, and therefore you have no control over them.

If you're looking for a great expire headers plugin, I recommend Far Future Expiry Header.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.