website js expire

Tom Hughes tom at compton.nu
Sat Oct 28 10:57:04 UTC 2017


On 28/10/17 10:35, ichwilldich12345 at gmx.de wrote:

> When accessing any site at https://www.openstreetmap.org/ a large script 
> of 1 mB is downloaded every time 
> (https://www.openstreetmap.org/assets/application-4d6830b2c7fa16ab8de03c882e3944a391b238a843949ed694ba7d2a13aee639.js).
> Currently the Expires header is set to the same as Date so it will not 
> be cached for next access.
> That results in long waiting times on mobile connections and 
> unneccessary data consumptions at the servers.
> This issue could be solved by extending expiry time to a few days or by 
> using 304 not modified status code.

Err, that exactly what we do. It has a one year expiry:

bericote [~] % HEAD 
https://www.openstreetmap.org/assets/application-4d6830b2c7fa16ab8de03c882e3944a391b238a843949ed694ba7d2a13aee639.js 
| fgrep Expires
Expires: Sun, 28 Oct 2018 10:56:31 GMT

Tom

-- 
Tom Hughes (tom at compton.nu)
http://compton.nu/



More information about the rails-dev mailing list