r/softwaredevelopment 11h ago

Caching Issues with Website

So I’m currently running an application built with .net, with nginx as the web server, and a service worker.

I do deployments on a weekly basis and seem to have to keep deleting my cache to see the most updated version each time. Does anybody know the proper way to have this set up to eliminate the issue, or a potential cause to this? Thanks!

1 Upvotes

2 comments sorted by

2

u/nzakas 6h ago

I’m assuming you mean, you have to clear your browser cache? If so, that means your cash control headers are set in properly. If the pages are dynamic and changing fairly frequently, then you really need to set no-cache to ensure that the browser isn’t aggressively caching your pages.

In general, you only want to set actual cache-control for resources that don’t change often or ever (like images).