Node/Express server hangs intermittently but automatically continues after a pause - html

Unfortunately I cannot put the code here because despite all kinds of debugging I cannot point to the problem to present the problematic segment of the code. If I try to load a HTML which in turn has other requests (js,css,png, etc.), it loads all except one... The server/browser hangs for some time and then after about a minute or so does actually load! If I try to test the server with individual manual requests of these very URLs in the HTML file, it works fine.
While tying to load the HTML file, Chrome Network tab shows "pending..." of one request or sometimes two. But ultimately all the URLs requested are served. Thats what bugs me...
I tried to set http.globalAgent.maxSockets to 100 as suggested here as the HTML file would make more than 8 requests for the different js, css, etc. This did not help either.
I have reached a deadend. Any help would be appreciated.

Related

How to ignore requests

I started using debugger for PHP recently and it's working well, but I have one problem. When I open page from Chrome I get notification from PHP Storm "Incomming connection from XDebug"...and I can accept or ignore it, which is ok. Then I can debug. And that's connection for the first page, i.e. index.php
Problem is that on page I'm opening I'm displaying i.e. some images and I'm including some CSS or JS file. For all those files Chrome is making additional requests and for all of them I'm getting also that message "Incomming connection from XDebug". So for every valid request I have to click Ignore about 20 times more...to ignore every other file after first one, containing page source.
I tried adding path to dirs I want to ignore in "Skipped paths" under Languages & Frameworks -> PHP -> Debug, but it's not working.
Can it be set somehow? Maybe some obvious ignores - I can't debug i.e. image files.

Application Cache - HTML 5

In one of the online documents that talks about appcache for HTML5, it indicates that the cached files get updated once an offline user reconnects. I checked the original HTML5 appcache definition by W3, and I am not able to find anything that supports this statement.
Does anyone know if this is to be true?
Thanks in advance
MDN says the following, although if you scroll up on that page it says it's being deprecated.
If an application cache exists, the browser loads the document and its associated resources directly from the cache, without accessing the network. This speeds up the document load time.
The browser then checks to see if the cache manifest has been updated on the server.
If the cache manifest has been updated, the browser downloads a new version of the manifest and the resources listed in the manifest. This is done in the background and does not affect performance significantly.
And logic tells me that it would also depend on the app you're using, server you're trying to connect to and any special settings it might have, how long your browser keeps it's history, what it keeps, and if you saved the page to view offline - whether or not you have all the code/images saved in the right location(s).
Example:
Imagine you saved a page to view offline, and that page has a JS event handler that ran a while loop that did an ajax request every n seconds to do something, like make a number on a page change as long as you were online... As long as the loop is running, you suddenly connect to the internet, and it makes the request to the proper url with the right arguments, then it should go through, even though the url in your browser might say something like file:///C:/Users/you/Desktop/....
I've done this before, even though my url was like the one above. One time I was using braintree's drop-in javascript to a website, and using it's api on my backend. Trying to load the page when offline = Nothing. Online = Updated the spot on the page just fine when I had the required arguments, and it was pointing to the right url. If I got offline again, I could refresh the page, see the same images loaded in the <div>, but I couldn't send any data with it.

I get an empty file for .har

I was always able to generate a .har file to help devs for troubleshooting issues. But recently I just get an empty file for that!
P.S. I use Chrome.
Does this happen on all websites? If not, wait patiently for file to export. Sometimes there are plenty of requests to save (for example some web socket stuff) and it takes time. Give it few minutes.
I am using Firefox 95 and I am having the same problem.
I noticed that the page has an problem will will not load completely. The loading indicator in the tab keeps animating.
I tried disabling cache and force refresh the page to get it to load completely.
After that, I was able to get a HAR file.

How can HTML assets be download before HTML content has finished dowloading

I am trying to improve my site load speed. When checking on the network requests, there is something that doesn't make sense to me:
How can the content that is going to be requested (css and js files) is being download before the html content has been downloaded?
I have tried with a hard reload and empty cache from chrome, but this has happened again. Morover, the files seem to be dowload from the server and not from the cache.
Another thing I don't get, is why chrome is pating the bar chart almost all with blue, when the majority of the time is waiting for the server to respond (TTFB).
Thanks in advance!
There's a couple of possibilities:
The HTML doesn't download all at once. It's possible for the server to send part of the page, pause, then send the rest. If the part that's sent first contains references to CSS, JS, image, font, or other files, the browser can start downloading those files as soon as it sees them referenced.
HTTP 2.0 supports "server push", a scheme where the web server can indicate to the client through HTTP headers that it should start downloading specific other files. Judging from some of the file names in your network tab, you're using Cloudflare; they use server push for some features, including "Rocket Loader".

From the browser, how to make the web server refresh/invalidate a cached static-html-webpage?

PROBLEM:
Today, we modified a static html web page in a client's website -
we added a couple of images and modified the font. And FTPed the file to client's web server.
We realized we made a mistake with the font-size, corrected it, and FTPed the file again.
Even with a 100 refreshes, the website was displaying only the file (with wrong font) that we had FTPed the first time.
We FTPed the corrected file several times, but the file with the wrong font was the only file being served by the web server.
OUR GUESS:
We think that the web server cached the file that we had FTPed the first time, and is serving it back to us on subsequent requests even though the file had changed.
We tried the following techniques (but were unsuccessful):
We added a parameter to the querystring (?R=33343545)
We tried the technique suggested below - i.e. posting to the webpage in question, but got a "405 Method not allowed. The HTTP verb used to access this page is not allowed."
http://www.mnot.net/blog/2006/02/18/invalidation
Please advise if we were on the right path and if there is anything else that we can try in such situations ?
EDIT:
We would like to find out if there is a way (similar to the 2 methods above) to do it just from the browser..and not touch the settings on the webserver.