I am planning to use .htaccess Leverage browser caching instead of CP panel.
I know that I need to only catch:
CSS
Images
JavaScript
Could anyone please post some awesome code for that will make Google happy and that is for MYBB?
This is not complete, but only a example... You can add further rules for other content types....
You can add it preferably as the first rule..... your server need to have mod_expires installed....
2592000 secs = 1Month
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/javascript A2592000
ExpiresByType text/css A2592000
ExpiresByType image/jpeg A2592000
</IfModule>
OR......
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType text/css "access 1 month"
ExpiresByType image/jpeg "access 1 month"
</IfModule>
How about this:
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
# Images
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
# CSS
ExpiresByType text/css "access 1 month"
# Javascript
ExpiresByType text/x-javascript "access 1 year"
# My favicon
ExpiresByType image/x-icon "access 1 year"
# Default directive
ExpiresDefault "access plus 1 month"
</IfModule>
## EXPIRES CACHING ##