The symptoms of my problem match this question pretty much exactly: Changed static files are cropped/padded to the new size and served the old - Fedora
Whenever I make changes to my static files (e.g. .js and .css), those changes don't show up in the served file. However, if my changes cause the file to change length, then the served file does match the new length:
The reason the linked answer doesn't solve my problem is that I'm not using Apache. I'm writing a Python web app for Heroku, so I'm using gunicorn and Flask (and therefore Werkzeug). The linked answer says that disabling sendfile in Apache solved the problem, so I tried setting the 'USE_X_SENDFILE' variable to False, as per this page, but it didn't help. I also set 'SEND_FILE_MAX_AGE_DEFAULT' to 1 in a further attempt to prevent some sort of caching from happening, and that didn't help either.
If it's not obvious, I really don't know much at all about configuring web servers, so having run out relevant Google hits, I'm at a loss as to what might be causing this. Help?
Virtualbox hates sendfile. If you turn it off it should work.
For example in nginx you would need to add sendfile: off;
.
In Apache it's just EnableSendfile off
.
In the end it turned out that this was probably being caused by VM issues. The code in question was located on a Windows drive, but was being served from within a Linux VM that was accessing the code via a shared directory. Remounting the share seemed to fix the problem (although not necessarily reliably).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With