4 ms·
> I've learned to press Enter on the URL line > instead of reload for exactly this reason. Yes, this is what I do too. The browser can do one of three thing
by combatentropy 10y ago
> I've learned to press Enter on the URL line
> instead of reload for exactly this reason.
Yes, this is what I do too.
The browser can do one of three things:
1. Serve the file from cache. This is what happens when you put the cursor in the address bar and hit Enter. Well, at least for ancillary files. It likely still will ask whether the main HTML document has changed. But it will load CSS and JavaScript files from its local cache --- if the webmaster properly set the HTTP headers, like Expires, to tell the browser that it can cache the files.
2. Ask the server whether the file has changed. This is what happens when you click the Reload button. This is the area of dispute. The article is saying it would probably be better if the browser acted just like it does when you put the cursor in the address bar and hit Enter. Instead the browser seems to check not only the main document file but also every single CSS, JavaScript, image, whatever, file. It doesn't redownload them all, but it sends an If-Modified-Since header, to ask whether they have changed, and then requests the whole file only for ones that the server says have changed. The payload back and forth is usually just a few hundred bytes for files that have not changed. But the network requests take a noticeable slice of time, because it's one request per file.
3. Ask the server for the whole file, regardless. This is usually when you hit Shift and Reload.