I have some static files I've been serving through Flask. On a given request, I run some processing and authentication, and then serve the file. I've been doing that using Flask's send_from_directory
, but it looks like that caches the file for a bit, which is no good for me. I have Flask running behind nginx, so I'm open to serving partially through nginx, but I need to run processing/authentication before the file gets served.
So, the main question is, how do I serve uncached static files with Flask and nginx assuming I need to do processing/authentication in Flask before serving?
Note: I've seen answers detailing how to serve files just through nginx, but that's no good for me because I have to do processing in Flask before serving.