mesa icon indicating copy to clipboard operation
mesa copied to clipboard

Tornado server loads cached javascript

Open aiwhoo opened this issue 4 years ago • 2 comments

Describe the bug Tornado server loads cached javascript. Any changes to simple_continous_module.js require manual cache removal or to go incognito.

Expected behavior javascript code should be loaded fresh on each run

To Reproduce hardcode the color red, run the program and view on browser, then hard code color blue in: https://github.com/projectmesa/mesa/blob/main/examples/boid_flockers/boid_flockers/simple_continuous_canvas.js

Additional context Using Chrome on Mac OS.

This may be useful https://stackoverflow.com/questions/12031007/disable-static-file-caching-in-tornado and somewhere around here should be modified https://github.com/projectmesa/mesa/blob/main/mesa/visualization/ModularVisualization.py#L243

aiwhoo avatar Mar 14 '22 04:03 aiwhoo

This seems to be a more recent solution: https://stackoverflow.com/questions/37905690/tornado-setting-headers-for-caching. @aiwhoo if you are up for it, a pull request would be great.

rht avatar Mar 14 '22 04:03 rht

Unfortunately, my tornado is limited, but I'll see how far we get in the next week. 🥲

aiwhoo avatar Mar 14 '22 04:03 aiwhoo