I have website in WordPress and I updated my .htaccess
file with following rule.
<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 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"
</IfModule>
Now, when I checked my website performance with Google insight. it still giving me error for leverage browser caching
I have used this code
add_filter( 'script_loader_src', 'elated_child__remove_ver' );
add_filter( 'style_loader_src', 'elated_child__remove_ver' );
function elated_child__remove_ver( $src ) { // Remove query strings from static resources
if ( strpos( $src, '?f=" ) || strpos( $src, "&f=" ) ) {
$src = remove_query_arg( "f', $src );
}
return $src;
}
Any idea?