Prevent browser form caching Ember app index page

When I release a new version of an Ember app: even when built with ember build --environment=production I get the old version of the app loaded by the browser.

I think it’s because the index page itself is cached, and the old JS scripts as well. Therefore I would like to force the index page to never be cached. Since this page is very light I don’t think that would be an issue (an ember app is really in the JS code).

When you say “release” what are you referring to? If you’re talking pre-deploy like on your local machine that sounds like a browser cache issue but if you’re deploying to S3 or some other service you might be running into a different caching layer. For example if you use a CDN like CloudFront you need to invalidate the old cloudfront cache of those assets. The cause is pretty dependent on how you’re serving the files so more clarification could help.

1 Like

I host on a VM and serve with nginx.

Hmmm I’m not personally very familiar with nginx but I’d guess that’s the issue. You probably want to just disable caching for index or maybe figure out a. way to invalidate the cache if there’s a new version.

1 Like