( Need Help ) Defer parsing of JavaScript - Leverage browser caching - Avoid bad requests

KJREDDY247@

Elite Member
Jr. VIP
Aug 31, 2018
4,215
2,705
When I checked one of my sites in gt metrics I got terrible scores in
Defer parsing of JavaScript- Leverage browser caching - Avoid bad requests

Leverage browser caching for the following cacheable resources: (expiration not specified)

Avoid bad requests: The following requests are returning 404/410 responses. Either fix the broken links or remove the references to the non-existent resources.

Avoid bad requests: 1007.6KiB of JavaScript is parsed during initial page load. Defer parsing JavaScript to reduce blocking of page rendering.

This is not a WordPress site. Can some kind-hearted expert please let me know the way to fix this or a simple guide to go through.

Thanks a lot in advance
 
Found Solution for this one and fixed. just in case if someone in the same kind of situation as me, edit the below code into your htaccess with custom adjustments.
Still looking for the help for other two issues

Leverage browser caching:

## 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 ##
 
2. The bad requests problem is usually happening due to invalid (removed) links or resources that are being called from your html or CSS. Check the Inspect Elements > Network tab for more info.
3. You need to have a better structure for the javascript that is being loaded on your website. Do you have an iframe youtube video somewhere on the page?
 
Back
Top
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features and essential functions on BlackHatWorld and other forums. These functions are unrelated to ads, such as internal links and images. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock