← Back to context

Comment by bigmicro

7 days ago

You can overcome this using headers, which instructs Gmail not to cache. Snippet:

response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"

response.headers["Pragma"] = "no-cache"

response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"

You might want to investigate this further - IIRC a lot of email services retrieve images in advance server side to avoid leaking whether the client has interacted with the email. I might be mistaken here.