I’m not sure what your .htaccess file looks like. Lets start over with that. Go to your permalink settings screen an note what the permalink style is. Via FTP or your hosting file manager, rename .htaccess. Go back to permalink settings and restore your preferred permalink style. WP will create a proper .htaccess if one is not found (if it is allowed to do so by server settings).
On your plugins list screen, deactivate and fully delete all caching plugins. This allows plugins to do special clean up that is sometimes needed. Ensure your site works properly even though there is no caching and it runs slow.
Pick one caching plugin, install and activate it. You’ll likely need to tweak its settings for optimal performance. I probably don’t need to tell you to never use more than one caching plugin again 🙂 (an optimization plugin is not the same as caching, but be sure to not enable duplicate functionality like combining CSS files or something)
hi @bcworkz I appreciate your help, I followed all your steps and everything seems to be in order now.
Unfortunately it seems like no matter what I do GTMetrix tells me im not leveraging browser caching. It is strange because I have gotten it to work before and it gave me a good score with a fast loading time on GTMetrix, after I got this good score is when I think I installed the second caching plugin and no matter what I do I cant get the good score again :(, even with a clean Htaccess file its very strange.
The two methods I have tried after getting a clean Htaccess file from your method
1. WP fastest Cache Plug-In
2.After this didn’t work I made a new Htaccess file using your method and I added this to the new Htaccess file
#Customize expires cache start – adjust the period according to your needs
<IfModule mod_expires.c>
FileETag MTime Size
AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript
ExpiresActive On
ExpiresByType text/html “access 600 seconds”
ExpiresByType application/xhtml+xml “access 600 seconds”
ExpiresByType text/css “access 1 month”
ExpiresByType text/javascript “access 1 month”
ExpiresByType text/x-javascript “access 1 month”
ExpiresByType application/javascript “access 1 month”
ExpiresByType application/x-javascript “access 1 month”
ExpiresByType application/x-shockwave-flash “access 1 month”
ExpiresByType application/pdf “access 1 month”
ExpiresByType image/x-icon “access 1 year”
ExpiresByType image/jpg “access 1 year”
ExpiresByType image/jpeg “access 1 year”
ExpiresByType image/png “access 1 year”
ExpiresByType image/gif “access 1 year”
ExpiresDefault “access 1 month”
</IfModule>
#Expires cache end
# BEGIN Cache-Control Headers
<IfModule mod_expires.c>
<IfModule mod_headers.c>
<filesMatch “\.(ico|jpe?g|png|gif|swf)$”>
Header append Cache-Control “public”
</filesMatch>
<filesMatch “\.(css)$”>
Header append Cache-Control “public”
</filesMatch>
<filesMatch “\.(js)$”>
Header append Cache-Control “private”
</filesMatch>
<filesMatch “\.(x?html?|php)$”>
Header append Cache-Control “private, must-revalidate”
</filesMatch>
</IfModule>
</IfModule>
<IfModule mod_headers.c>
Header unset ETag
</IfModule>
FileETag None
Neither method was able to get my score back to how it was that one day on GTMetrix. 🙁
The items GTMetrix has trouble with regarding caching are 3rd party resources you have no control over. It doesn’t matter what you do on your site other than removing the resources. There are an awful lot of embedded videos. They always seem to take an inordinate amount of time IME. Consider using static placeholder thumbnails which link to the actual video embedded elsewhere on your site, preferably with only one or a few embeds per page.
I don’t know how you were so successful earlier, I think it was an anomaly with GTMetrix.
@bcworkz oh ok I see, because I sell music on my store I use a lot of embedded music players with an mp3 to provide a preview to the customer. maybe this is the main cause of the general slowness. maybe the homepage videos can improve speed too if replaced with photos. Thank you for your help.
-
This reply was modified 5 years, 7 months ago by
andreee.