Closed ebudan closed 5 years ago
Adding the following in ServeHTTP() would seem to resolve caching in the mentioned browsers:
...
w.Header().Set("Cache-Control", "public, max-age="+strconv.Itoa(int(rule.Duration.Seconds())))
...
ok. That I can do.
Setting Last-Modified should be done by Caddy itself as it would make much more sense.
Done (finally)
This is noticed on Chrome (Version 54.0.2840.71 (64-bit)) and Firefox (49.0.2) on OS X:
The Expires header itself is not enough to persuade the browser to reload a modified page. In Safari, seems to work as expected.
(Edit: removed comment regarding Last-Modified - was not correct. Added browser info.)