I've noticed that when I refresh my app one of my JS assets is sometimes loaded with 304
response, while mostly it is loaded with 200 (from cache)
. It wouldn't be a big deal, if it would actually load it - whenever I get 304
, the file is not loaded (the response is empty) and I end up with JS error (because my var from that file is not recognized). After the error, I copy-paste the URL to a new tab and then my JS file is loaded correctly.
But when I refresh the page instead, I have the same error, strangely not always - after several refresh attempts the file is loaded with 200
and JS error is gone.
I wish I would know what could cause this strange behavior, or how can I force to load this file.