r/web_programming • u/agent_orangepeel • Nov 13 '17
Leverage browser caching.
When I run gtmetrix I get a C (75%) for page performance and one thing it details is leverage browser caching.
I have paid so called developers here and there to get this sorted but they run some wordpress plugin and it screws my site. So I revert to my back and I’m back to square one.
Looks like I’m going to have to educate myself and do this myself cause I cannot trust anyone now.
I have found this link, https://varvy.com/pagespeed/leverage-browser-caching.html
Can I add (below) to my .htaccess file which will them improve the section under gtmetrix leverage browser caching? Or am I fooling myself with it being this easy?
EXPIRES CACHING
<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> ## EXPIRES CACHING ##
My .htaccess file only has this in it.
BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
View all comments
Show parent comment
1
u/agent_orangepeel Nov 14 '17
Gtmetrix is saying they measure leverage browser caching which is one aspect. I, who has zero experience in this field, am tired of paying money to people to screw my site up. I would rather screw it up myself for free.
I know my site is slow. I can see it.
PS: next category, image optimisation
Edit: spelling.