Copy link to clipboard
Copied
Am trying to optimize my page and it says to add a Leverage browser caching and Cache validator to my .htaccess file. How do I do that/ whats the code for it.
This is what my .htaccess file has on it, I have not edit anything on it. My page is jooel.me .
# Begin cache control #
ExpiresActive on
ExpiresActive off
<FilesMatch ".*">
Header unset Cache-Control
Header unset Expires
Header unset Last-Modified
FileETag None
Header unset Pragma
</FilesMatch>
# End cache control #
Add this to your .htaccess file. These are merely recommendations. Adjust duration & file types to match your particular project needs. Most people don't use Flash anymore so you may not need it. Or if you update/change images often, you may want to reduce the access duration on that file type to something lower than 1 year.
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/g
...Copy link to clipboard
Copied
Add this to your .htaccess file. These are merely recommendations. Adjust duration & file types to match your particular project needs. Most people don't use Flash anymore so you may not need it. Or if you update/change images often, you may want to reduce the access duration on that file type to something lower than 1 year.
## 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 ##
Copy link to clipboard
Copied
Thank you, so do I just copy and paste that anywhere in the .htaccess file?
Copy link to clipboard
Copied
Check with your web host.
Copy link to clipboard
Copied
Ok, thank you very much again.