Can we configure CloudFront Cache-control
/Expires
response headers, when generating signing URLs?
#4641
Unanswered
iamFIREcracker
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a CloudFront distribution which serves images stored inside an S3 bucket:
Now, since these images rarely change, we started caching signed URLs inside the application server, hoping that user browsers might be able to serve from the local cache instead of fetching from CloudFront over and over again (especially when the content did not change).
All good in theory; in practice, what we are observing is that none of responses generated by CloudFront seems to include neither the
Cache-Control
nor theExpires
header, which makes it impossible for the user browser to cache and re-use content.I know it's possible to define a custom "Response headers" policy via the console, and attach that to our distribution; but what if we wanted something a bit more granular? What if we wanted to control that at Signed URL creation time? This seems to be possible when signing S3 files directly (via the:
ResponseCacheControl
parameter), but not when signing using CloudFront. Is that the case or am I missing something? Note that I am not necessarily interested in setting these headers with a value different from whatever we specified asexpires
parameter when using the canned policy; I would be OK if CloudFront set either one of these headers automatically based onexpires
(which is also available in the signed URL).Beta Was this translation helpful? Give feedback.
All reactions