We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Leverage browser caching | Forum

Simone
Simone Nov 11 '15
Hi,

when i do pagespeed test (example: https://gtmetrix.com)

they says me 


Leverage browser cachingWhat's this mean?The following cacheable resources have a short freshness lifetime. Specify an expiration at least one week in the future for the following resources:


What can I do to impreve this?


I have ubuntu + plesk 12.5 + Apache


Thank you

Lars
Lars Nov 11 '15
To be honest, it would go way too far, to answer it in detail. There're a lot of ressource about it on the web. Just one thing - It has nothing to do with oxwall itself, but with the way your browser treats ressource like images. How long should it store something, until it refreshes it?


It is something you have to change within your htaccess file. That being said - If you never worked with those things, you might want to read a few articles and guides. Changing the htaccess not only can stop your site from working, but also can be a security issue, if someone is able to access your server files after you changed something wrong. So that someone can read your config.php with your database login details for example. Might not happen, but it can!


Google loves that browser caching, as it means, that a site gets loaded faster, if the ressources are already there and not have to be loaded. That also helps the server, as it lowers the requests, which again might help every visitor.

The Forum post is edited by Lars Nov 11 '15
tammy harris
tammy harris Nov 11 '15
Htacess works ok but if you can edit apachis config file and add it there saves lots server resources  and will bring page load times down 
ross Team
ross Nov 11 '15
Simone, please take a look at this: https://www.google.com/...;espv=2&ie=UTF-8
ross Team
ross Nov 11 '15
Baldwin Jackson
Baldwin Jackson May 8 '18
Hello mate you can add the following code in your .htaccess file to solved the Leverage Browser Caching issue. Generally there are some plugin which also optimize Leverage Browser Caching in WordPress website but several WordPress users are non-technical that why folks recommend to use plugin. All the best 


<IfModule mod_expires.c> ExpiresActive OnExpiresByType 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>