Reputation: 1
GTMetrix Speed Score is not increasing This Website Shows 4 types of problems for speed issues. Problems are:
For Defer parsing of JavaScript, I used the following code in function.php in theme editor
function defer_parsing_of_js( $url ) {
if ( is_user_logged_in() ) return $url; //don't break WP Admin
if ( FALSE === strpos( $url, '.js' ) ) return $url;
if ( strpos( $url, 'jquery.js' ) ) return $url;
return str_replace( ' src', ' defer src', $url ); } add_filter( 'script_loader_tag', 'defer_parsing_of_js', 10 );
For Leverage browser caching, I used the following code in .htaccess
<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> <IfModule mod_headers.c> <filesmatch
"\.(ico|flv|jpg|jpeg|png|gif|css|swf)$"> Header set Cache-Control
"max-age=2678400, public" </filesmatch> <filesmatch
"\.(html|htm)$"> Header set Cache-Control "max-age=7200, private,
must-revalidate" </filesmatch> <filesmatch "\.(pdf)$"> Header
set Cache-Control "max-age=86400, public" </filesmatch>
<filesmatch "\.(js)$"> Header set Cache-Control "max-age=2678400,
private" </filesmatch> </IfModule>
For Serve scaled images
I did it manually from the file manager.
But the speed score is not increasing in any way. it remains the same.
What could be the solution?
Upvotes: 0
Views: 63