[OpenWrt-Devel] uhttpd: add configurable client Cache-Control http header

Karl Palsson karlp at tweak.net.au
Wed Jul 4 10:01:21 EDT 2018

Florian Eckert <fe at dev.tdt.de> wrote:
> I am working with luci-ng. And i have problems with caching
> with the following Browser Edge, Internet-Explorer and Firefox.
> Chrome is working fine. If the javascript or html files have
> changed on the system for example on sysupgrade then the new
> files will not get loaded from uhttpd server. The browsers
> always used the cached version and not the new version from
> uhttpd.
> To fix this tell the uhttpd to send the header Cache-Control
> no-cache on file download. This header tells the browser to
> always check if the file has changed on the server. If the file
> has not changed then the server send a 302 status header. The
> status header 302 tells the browser to load the file from the
> browser cache because nothing has changed. On the other side if
> the file has changed then the browser will deliver the new one.

That _seems_ like an exceptionally big hammer.

I just made all my code request js files with ?ver=xxxx version suffixes, so that only the right versions were cached.  

Karl P
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.html
Type: application/pgp-signature
Size: 1161 bytes
Desc: OpenPGP Digital Signature
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20180704/4ffdf6d5/attachment.sig>
-------------- next part --------------
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list