3

I am using cloud front as CDN. Is there a way to force a content update? I have a file on my origin server which I've updated with a new version (same name, new date time stamp). But when I check it in cloudfront, its still the old file.

I have seen this thread which suggest one way as invalidate, but I don't want to do that because its an overhead I think and there can be maximum 3 invalidation request running at a time. I read that cloudfront is supporting dynamic content using query parameters, can I make use of it somehow to force cloudfront to pull the latest content from the distribution server.

Community
  • 1
  • 1
GG.
  • 2,835
  • 5
  • 27
  • 34

1 Answers1

5

The first one is as you mentioned to explicitly call invalidate(). They do have a 3 invalidation request limit, but each request can contain up to 1000 objects which in most cases are fairly enough. It usually takes 10 - 15 mins according to the doc, but my experience of this is rather fluctuated (can take up to 30min in some cases).

The other approach of dynamic parameter is definitely doable and which is a preferred way. What you need to is append a timestamp param at the end of you link's end. Something like:

http://www.example.com/img/logo.png?timestamp=123456789

Once you updated your logo.png, change the timestamp to the new one:

http://www.example.com/img/logo.png?timestamp=223456789

And cloudFront will be able to distinguish these two and pick the right one.

So yes, I believe your analysis is on the right track.

Yudong Li
  • 1,784
  • 2
  • 17
  • 32