-
This is all new to me but I noticed after following the instruction for hosting pmtiles on AWS that they weren't being cached by the browser or cloudfront. CloudFront has a Cache Policy setting that by default, for lambda url functions, is set to "Cache Disabled" instead of "Cache Optimized" Also for the pmtiles files loaded into the s3 bucket I think you need to set a And in the cors settings add a custom header with the Cache-Control header |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Thanks, I've updated the docs to specify that The docs should address CORS + CloudFront already. The one possibility this doesn't handle is if you want different cache TTLs applied to different PMTiles files. This is technically possible but the Lambdas as implemented don't pass this information through yet. Is that what you were hoping to achieve? |
Beta Was this translation helpful? Give feedback.
-
Thanks~! I don't need multiple cache expiration times. I was just stumbling around trying to get the tiles to be cached & thought to make a note here.. I'm not surprised I set it in too many places. |
Beta Was this translation helpful? Give feedback.
Thanks, I've updated the docs to specify that
CachingOptimized
should be selected for cache policy. It should set a default TTL of 86400 seconds. I don't think that setting metadata on each file should be needed as that's an extra step.The docs should address CORS + CloudFront already.
The one possibility this doesn't handle is if you want different cache TTLs applied to different PMTiles files. This is technically possible but the Lambdas as implemented don't pass this information through yet. Is that what you were hoping to achieve?