chanzuckerberg / single-cell-explorer

Hosted version of cellxgene
MIT License
11 stars 2 forks source link

[Optimization] Add cache header to cache images in the browser and CloudFront #956

Open tihuan opened 2 months ago

tihuan commented 2 months ago

Context: Currently deep zoom assets aren't cached in the browser, so the browser would still request for the assets even when it already got it

DoD:

  1. Update CloudFront cache header to tell the browser to cache the images for at least an hour

Example:

Header Name: Cache-Control
Header Value: public, max-age=3600

In dev Cloudfront:

Screenshot 2024-05-30 at 9.36.41 AM.png
tihuan commented 2 months ago

@ebezzi I see that staging spatial-deep-zoom cache behavior currently uses Cache Policy CachingOptimized. Can we add Cache-Control: public and max-age: 3600 on it, or do we need to create a new policy to do that?

Thank you!

tihuan commented 2 months ago

Bumping this to p0, since the zooming experience is significantly better with browser caching enabled

tihuan commented 4 weeks ago

Still not cached Screenshot 2024-07-23 at 1.57.30 PM.png