browser caching static files in flask?
13,708
Either use 'SEND_FILE_MAX_AGE_DEFAULT' or look into webassests http://webassets.readthedocs.org/en/latest/
Similar question asked here. Flask static file Cache-Control
Author by
arjoonn
I like machines, education, learning systems, and the Internet. All of the above is aided by Python.
Updated on June 13, 2022Comments
-
arjoonn almost 2 years
Have been reading flask docs in python and building a local website.
Just performed a speed test on my website deployed on openshift with this tool here:-
The analysis report says that my site is not caching static resources. After googling this for all my worth I gather that:-
- It has something to do with headers.
- Cache copies are kept in the client machine and also servers between the client and website.
My Question
Am I to include expire and tags in the html section? Or in the HTTP header section?
If in the HTTP header section how do I do this?
If I have missed something in the docs please let me know.
-
arjoonn almost 10 yearsI have seen the mentioned question. The problem there is that the cache is set to a very big default value. My problem is that the tests show that my website does not cache static elements.That answers my basic requirement of completing the task. I would also like to know if the tags are added in the HTTP or HTML doc headers. Thus the new question fo ra consolodated future resource.
-
PsyKzz almost 10 yearsHTTP headers. The Response headers.
-
arjoonn almost 10 yearsRight then. But why is the content not cached for long? I have further checked at tools.pingdom.com/fpt