Firefox – Does saving a web page using Ctrl+S in Firefox make the browser load the site a second time

downloadfirefox

When saving a website for offline reading with Ctrl+S in Firefox, I notice that the download process takes some seconds to finish although the web page is already loaded.

I'm wondering whether saving the web page like that will make Firefox fetch all the content (HTML, images, JavaScript, CSS, etc.) a second time, or whether it will just get it from the already loaded files in the cache.

Best Answer

No, it does not trigger a second request.

I just tested it by running a simple HTTP server to log the requests. The server did not receive a second request when saving the website.

  • Tested with: Firefox 61.0.1 (64-Bit) on Ubuntu 18.04
  • Server: SimpleHTTPServer module of python 2.7.15 (python -m SimpleHTTPServer 7070)

Edit:

Commenters asked about different behavior if the server is sending "no-cache" headers. I tested it with Pragma: No-Cache and Cache-Control: No-Cache and the result stays the same.

The code I used to do the test (via this answer):

#!/usr/bin/env python
import SimpleHTTPServer

class MyHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
    def end_headers(self):
        self.send_my_headers()

        SimpleHTTPServer.SimpleHTTPRequestHandler.end_headers(self)

    def send_my_headers(self):
        self.send_header("Pragma", "No-Cache")
        self.send_header("Cache-Control", "No-Cache")


if __name__ == '__main__':
    SimpleHTTPServer.test(HandlerClass=MyHTTPRequestHandler)
Related Question