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

Florian Eckert fe at dev.tdt.de
Thu Jul 5 02:17:04 EDT 2018


Thanks for reply

On 2018-07-04 16:01, Karl Palsson wrote:
> Florian Eckert <fe at dev.tdt.de> wrote:
>> 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.

We could also use additional the other options, which are allowed by 
http Cache-Control header.
I have found an interesting article from google about the caching topic.
It is only in german :-(
But the graph with the head "Optimale Cache-Control-Richtlinien 
festlegen"
is interesting.

May be we could change the option from no_cache -> cache-control?
With the following options:

no-cache
no-store
max-age=<seconds>

So each uhttp instance could be configured to send a Cache-Control 
header or not.

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

Yes i have seen this in luci but not in luci-ng.

_______________________________________________
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