Open JeffAbrahamson opened 1 year ago
Maybe we should add a timeseries_plot imagefield to mobilito_session model and save it there ? Instead of rendering it everytime
Maybe we should add a timeseries_plot imagefield to mobilito_session model and save it there ? Instead of rendering it everytime
Even better is to serve it once and not again. We want it cached on the edge, not cached on our server.
And why isn't it cached already then ? The image name seems to be constant, why isn't cloudflare picking it ?
The images set a cookie, which they don't need to do, but which leads to them not being served from cloudflare
A cookie ?
I'm afraid I'm a bit lost here, I don't see cookies, and even then, how would that prevent cloudflare from picking the file ?
Pretty sure sessionid
comes from django, and that we can selectively turn it off, if only by deleting it from the response we serve. Need to check the docs on cache control and search for "django cloudflare" to see what's known.
jeff@birdsong:~ $ curl -I https://beta.mobilitains.fr/mobilito/session_ts_img/701dda65c29562ba376dcba4ad196613941a8970/
HTTP/2 200
date: Thu, 01 Dec 2022 16:39:09 GMT
content-type: image/png
content-length: 38905
x-frame-options: DENY
vary: Cookie
x-content-type-options: nosniff
referrer-policy: same-origin
cross-origin-opener-policy: same-origin
set-cookie: sessionid=yuc04bni6v91swbomixo2h1ujg71eys2; expires=Tue, 30 May 2023 16:39:09 GMT; HttpOnly; Max-Age=15552000; Path=/; SameSite=Lax
cf-cache-status: DYNAMIC
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=R7n3yBAiE6%2BWIfar0gl7yoAYuBLmag2oZHa%2FTtcM3MoW5VWMqML3dJBCXszQJpHR%2Fe%2BnmB2DdDbu0SmyDUhiN%2F%2BzFVy2hIgp1dtU%2B5uD1l7ET%2F8xlcKZyKU2rPZLQDV3JuymMKnX"}],"group":"cf-nel","max_age":604800}
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
server: cloudflare
cf-ray: 772d41da3da7f108-CDG
alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400
jeff@birdsong:~ $
The header says "server: cloudflare" in your CURL and also in my browser :
Isn't it what you were looking for ? What makes you think it's in fact not Cloudflare ?
@JeffAbrahamson bump
The images set a cookie, which they don't need to do, but which leads to them not being served from cloudflare