Shubhang Desai
Shubhang Desai

Reputation: 319

Endpoint which returns send_file not called again

I am writing a Flask app in which I have an HTTP endpoint which returns a send_file of an image I create in the function. Unfortunately, it seems the browser caches that image and doesn't even call the endpoint again, loading the original image on subsequent reloads.

Any idea why this is happening and what the fix might be?

Upvotes: 1

Views: 227

Answers (1)

Raja Simon
Raja Simon

Reputation: 10315

send_file has the option called cache_timeout use that to get rid of browser cache problem.

send_file('filename', cache_timeout=0)

Upvotes: 2

Related Questions