HEBorn icon indicating copy to clipboard operation
HEBorn copied to clipboard

index.html should not be cached

Open renatomassaro opened this issue 7 years ago • 3 comments

We can heavily cache both app-[hash].{js,css}, but index.html should always be fetched from origin, so it returns a new hash in case app.js/css has changed. Index.html is quite small anyway, it represents less than 1% of the total page size.

Not sure if it's being cached by nginx or cloudflare or both.

renatomassaro avatar May 19 '17 21:05 renatomassaro

Caching mode is passed through the HTTP header, so probably you should check the webserver. If I'm not wrong, cloudflare should only pass their personal cache when there is no response from the server...

PedroHLC avatar May 21 '17 01:05 PedroHLC

Yep, solution is to simply set cachecontrol header to no-cache and properly change the ETag every time the underlying file changes.

renatomassaro avatar May 23 '17 17:05 renatomassaro

@renatomassaro pls add this config to NGINX and close this issue

add_header Cache-Control no-cache;
expires 1s;
proxy_no_cache 1;
proxy_cache_bypass 1; 

PedroHLC avatar Sep 15 '17 00:09 PedroHLC