Skip to content Skip to sidebar Skip to footer

Flask: Caching Static Files (.js, .css)

I really could not find any resource on this. So how can I seperate caching of views/functions than static files (i.e. .css,.js)? I want to cache my static objects for a week, on

Solution 1:

I would not server the static files from my python application but try to delegate that to the web server (nginx, apache... ). Then you could set the time to expire through headers controlling how long should the browser cache them.


Post a Comment for "Flask: Caching Static Files (.js, .css)"