Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting Firefox to cache an exe download

I'm having some trouble getting Firefox to cache an exe file that we have on our web site. If I download it with IE or Chrome and start the download a second time then the second download finishes immediately but with Firefox it downloads everything from the start.

I've attached screenshots from the network tab in Chrome and Firefox. Notice that both receive HTTP Status Code 200 but Chrome says (from cache). What response headers do I need to add to make Firefox cache it?

Chrome:

Chrome

Firefox:

Firefox

Here's the url if you wish to try downloading it it yourself: https://dlud0tbph7s2n.cloudfront.net/Production/Windows/DegooSetup-Production-1.0.1052.exe.

like image 205
Yrlec Avatar asked Sep 29 '22 21:09

Yrlec


1 Answers

You can check if the exe file is cached by looking in 'about:cache' or using a tool like HttpWatch.

Your EXE file is not getting cache. In older versions of Firefox that could be due to the file exceeding the maximum size for a single cache entry. By default, the maximum entry size is now 50 MB. You can check this by looking at 'browser.cache.disk.max_entry_size' in 'about:config'.

The problem might be caused by the very large value of max-age that you have set - 2000000000 seconds is about 63 years. The HTTP spec only recommends using periods up to one year and some browsers refuse to cache for very large values of max-age:

https://stackoverflow.com/a/25201898/66911

The recommended maximum value of max-age is 31536000 seconds or less.

like image 54
HttpWatchSupport Avatar answered Oct 05 '22 06:10

HttpWatchSupport