Nginx + PlayCanvas Disable Cache?

Hello!
Self hosting my build on an ubuntu server with nginx. Im having trouble disabling caching. I have tried:

nginx.conf

add_header Last-Modified $date_gmt;
add_header Cache-Control ‘no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0’;
if_modified_since off;
expires off;
etag off;

index.html

<meta http-equiv=“Cache-Control” content=“no-cache, no-store, must-revalidate” />
<meta http-equiv=“Pragma” content=“no-cache” />
<meta http-equiv=“Expires” content=“0” />

Im often pushing fixes to bugs and i need them to get to my user immediately, not 3 days later.

Any suggestions? Thanks!

@yak32 might know

AFAIK, you would only need to invalidate the config.json file for new uploads as the engine/editor build uses a filehash param for asset requests so that it cache busts for new uploads. There shouldn’t be a need to not allow caching for every file

please check this: Module ngx_http_headers_module

by using expires off; you are actually disabling caching-related headers, not caching itself.
I suppose you need to use expires 0;

1 Like

Great thanks for the input! Here is the headers on my build. I will update you if it doesn’t work but it seems to be so far. Side note the “Date” and “Expires” response headers reflect the exact time of page load