-1

I'm told I should cache the above resources in order to optimise my site, but I can't seem to find/understand instructions for doing so. What are the manual instructions for caching this info, and where do I put them?

Dimi
  • 3
  • 5

2 Answers2

1

Use .htaccess for compressing and caching. Add this to your .htaccess. Please backup your .htaccess before doing this (Just for safety). This will apply to all cacheable resources.

<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
CodeRomeos
  • 2,428
  • 1
  • 10
  • 20
  • This is what I was looking for. Thank you. :) – Dimi Sep 30 '15 at 11:02
  • A follow-up question: according to a website speed test, my performance has now dropped by 40 percentage points. I'm now told 1) 'Resources with a "?" in the URL are not cached by some proxy caching servers. Remove the query string and encode the parameters into the URL for [list of resources].' and 2) that the Google font still isn't being cached: 'The following cacheable resources have a short freshness lifetime. Specify an expiration at least one week in the future for the [Google font].' Any solutions for these? – Dimi Sep 30 '15 at 11:19
  • 1
    Don't give too much credit to that kind of "performance validators". Even the one from Google throw up things that doesn't really apply to 99.999% of the website out there and doesn't really affect performance on small to medium sized websites (like the recommandation to put css inline). Focus on: distributing the right images sizes to mobile, compress them, minify your css/js, and last but not least use a cache plugin for Wordpress (like W3 Total Cache, which works pretty well). – vard Sep 30 '15 at 12:45
0

You can use a Content Delivery Network (CDN) for this as well. CDN will speed up your site loading time.

Please take a look in here for a better understanding : http://premium.wpmudev.org/blog/top-cdn-services-to-make-your-wordpress-site-blazingly-fast/

mmaumio
  • 117
  • 1
  • 9
  • I'm a newb to web admin so I'm worried about handing my site over to a foreign third party. I feel better about having someone in my country I can get on the phone, at least for now. – Dimi Sep 30 '15 at 11:01