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

Florian Eckert fe at dev.tdt.de
Wed Jul 4 09:26:57 EDT 2018


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.

This makes following patches deprecated
http://lists.infradead.org/pipermail/openwrt-devel/2018-July/013098.html
http://lists.infradead.org/pipermail/openwrt-devel/2018-July/013097.html


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list