I've been trying to track down what is causing my website to load slowly. Chrome's network inspector shows a gap of over half a second before the page resources are requested. All resources are stored on the same domain so DNS shouldn't be an issue. There are no scripts embedded in the page.
Note: The blocked resource is a tracking script being stopped by an ad blocking extension. With the ad blocker disabled or the tracking script removed I still have the same issue.
Refreshing the page after the initial load or navigating to other pages on the site - even with the cache disabled often doesn't show the same delay.
Related
I created a Trusted Web Activity App for one of my friends.
Link: https://play.google.com/store/apps/details?id=com.grodudes.app
It's working absolutely fine but I am facing a small problem it is showing the cached pages even when the device is online and it causes problem like showing the user is logged out when moving to a different page even though he is logged in. Reloading the page fixes it.
How can I fix it?
I have a page - quite complex, lots of resources etc.. but it all loads without problems.
However, Google Chrome shows that little "loading" animation in the tab, and there's the "Waiting for (IP)..." bubble in bottom left of the page.
Everything is loaded, as confirmed by developer tools.
Sometimes, I get this in Console, but not always:
Failed to load resource: net::ERR_NETWORK_CHANGED
Failed to load resource: net::ERR_CACHE_MISS
Firefox loads it without problem.
What can be the problem?
(sorry, it's on intranet and I'm not allowed to make it accessible - so just in case you encountered similar issue)
I made an offline webapp.
Used application cache and all the resources are added in .appcache file.
I have also added meta tag suggested by apple.
<meta name="apple-mobile-web-app-capable" content="yes" />
When I add it to home screen, it is added & opening in full screen mode.
While all the resources are cached by browser and I am getting no cache update request on reload.
But I try to open webapp while I am offline first time, it is giving me alert "Could not be opened because it could not connect to the server".
By the all the resource of app is already cached by browser still getting this error first time.
But If I open webapp first time while I am online, it is caching all the resources & then second time app is working fine even in offline mode.
Thanks Guys.
When you add to homescreen that is the first time only a reference is added, think of it like a bookmark no content gets downloaded. That only happens after you open it for the first time. Seeing the web app in safari & adding to homescreen does not count since apple seems to maintain the data separately for apps added to homescreen via safari.
The Browser is a different app to the one which runs home screen web app.
I got caught the same way with my offline web app, to debug you change the settings in safari but the actual cache is different, the executable running the home screen app is different, it has several safari functions missing - google uiwebview and wkwebview
I don't know what is currently used for the user agent string, but they used to be different for browser based and home screen based back in ios7
I'm having a very strange problem with a site in Google Chrome:
When I click on a link (from a list view to a detail page), the page hangs and I Chrome throws up a dialogue asking me to kill the page. The page is never displayed.
But if I navigate directly to the page, it loads in Chrome without any problems. Both actions (clicking on a link or navigating to the page) work fine in Safari and Firefox.
Disabling "Predict network actions to improve page load performance" in Chrome's settings seems to fix the problem, but this is not a viable solution as I don't have any control of my user's browser settings.
Some more detail about the situation:
The link is just a regular <href>. I'm not doing any javascript
click() handling or anything else. I'm not using any 'prefetch' or 'prerender' <link> elements.
The pages all validate using the W3
html5 validator.
The page I'm navigating to loads a lot of JS, uses Knockout.js for rendering and loads a video file over HTTP.
On the occasions that the page does load (after a very long wait),
Chrome appears to have rendered the entire page in the background and
loaded all external resources. If I navigate directly to the page it
doesn't preload anything though (I'm using knockout to show a 'please
wait' message while the external resources load).
When I log the network requests using Charles, it appears that
Chrome loads the HTML for the page instantly, but the requests for
the external resources seem to take forever.
If I look at the CPU usage in Activity Monitor, 'Google Chrome Renderer' uses 100% CPU when loading from the href, but only 30% when loading directly from the page.
I'm using the latest version of Chrome (22.0.1229.94)
So - my question
Is there a way to programatically disable "Predict network actions to improve page load performance"?
Or is there some other solution to this problem?
Just going through high voted unanswered questions I came across this one, and I once got into a similar situation for entirely different reasons (chrome was preloading a huge file I couldn't afford to load for every user). The fairly simple solution I applied back then was to open the link through Javascript rather than a simple href which worked wonders. Either way, your problem might already be solved, but seeing the number of views I thought I could at least share this small insight.
I read in a source that chrome, when it goes to a domain, it prefetches most of the pages that might be used for that domain. As a result of this, I'm facing a problem. I have a greasemonkey script which is to be injected in every page. But what seems to happen is that the browser injects the script for the first page in a domain and that remains when i go to another page, instead of being re-injected (which is what i would want). Any ideas on how i could achieve this behavior ??
Google Chrome will precache DNS entries on the page but it doesn't pro-actively go and fetch pages, Firefox however, does prefetch pages.
Actually, there is a case where Chrome will proactively pre-cache any page that is mentioned in the cache manifest. This is designed for offline scenarios. However, each page when downloaded will not be executed against any injected script, nor will it run any JS on those pages.