Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do javascript frameworks treat 304 not-modified?

I'm curious how this works in Jquery, but also in general. When a JS resource is fetched, and the server indicates a 304 not-modified, does a framework:

  • Load the JS file from cache and execute it
  • Not execute it

I'm trying to support a polling solution, and if I can get Jquery to do nothing upon recieving a 304 my work is done, otherwise, I have to write the resource in a safely-reloadable (idempotent) way, which is harder (imagine adding a status div to the page, where you wouldn't want to do that again if the status hasn't changed)

like image 713
Dean Radcliffe Avatar asked Jun 23 '26 04:06

Dean Radcliffe


1 Answers

It'll load the js file from cache and execute, either way, it will execute each time. Sorry, it's the harder way you'll need :).

like image 170
Francis Gilbert Avatar answered Jun 25 '26 18:06

Francis Gilbert



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!