plnkr / feedback

Feedback on Plunker
19 stars 11 forks source link

JS changes not propagated without hard reload #477

Closed emplumb closed 4 years ago

emplumb commented 4 years ago

After clicking the refresh live preview button, the console does not reflect any updated code. I either have to hard reload the page or click the Preview button to toggle the live preview pane off and back on again.

Last week, the refresh button did propagate new changes so I know it hasn't always been like this. I have only attempted this with the console.

Both Firefox 70.0 and Chrome 78.0.3904.70 are behaving this way.

Screen Shot 2019-10-28 at 11 28 58 PM
BernieSumption commented 4 years ago

More info on why this is happening.

In a plunk with multiple files, the main HTML file is served with cache-control: no-cache, but the JS files are served with cache-control: private, max-age=14400. The URL of the JS files don't change when they're edited, so when the HTML file reloads, the JS files are loaded from a stale cache.

Reproduction:

http://next.plnkr.co/edit/8TLVIKV0sgPQdthO

  1. Run the plunk and click on the button
  2. Edit main.js to change the alert message
  3. Click the button again, the old message will show
ggoodman commented 4 years ago

Fixed. There was a misconfiguration at the load balancer level.

@BernieSumption took me ages to track this down. If only I had read further into your observations I might have found the issue much faster. Thanks for diving in!