-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bundle-common.js and page specific bundle-*.js is loaded 2 times on the page load #177
Comments
The "prefetched ones" are intentional, and desired. More details about what these mean can be seen here:
In your screen-shot, I can see that you have enabled the "disable cache" feature, which instructs the browser to disregard all its internal caches where possible. That's why you have duplicate fetches of the same asset(s). I recommend you untick that box and then review the "size" column, which should show that one of the "duplicates" is a fetch (probably from disk, but possibly from the network), and the other is loaded from the prefetch cache. |
@fredden I disabled cache to check the hits on server. And I see 2 hits on the server. For any new user who accesses the site, it adds 1 additional request on server along the original one, but the successive calls are prefetched cached and we are good on that. Il go through the documents you have shared, but also want to know if there will be any issue if we ignore the prefetch scripts on the phtml? I didnt see any though, but would like to hear from you |
That's curious; I'm only seeing a single request for each asset in the web server logs that I reviewed just now. Are the cache-related headers that the browser receives sensible? Is there a public URL that you can share of a website you're having trouble with? Yes, you can remove the |
@fredden I don't have a public URL to share for now, but I checked on the access logs and I can confirm we do see 2 requests for the first hit on server. For now I have added the below patch to enable/disable Prefetch |
@fredden @salmanazeez786 I guess the author have tested with devtools opening and enable Disable cache option so the prefetch and the include will be 2 load times. This is not an issue. |
I see that the bundle-* files are loading twice on the Homepage, PLP and PDP pages for which I have created the magepack bundles
Further looking in the code , I see the layout xmls are adding the bundle-common.js & page specfic bundle-*.js in the head section,
But the same bundle-common.js and page specfic bundle-*.js is also added as a prefetch link in phtml templated which loads in all pages
Is this expected ? or can we remove the prefetched ones ?
The text was updated successfully, but these errors were encountered: