Search code examples
amazon-s3amazon-cloudfront

CloudFront files linked to S3 don't always load and sometimes slow


Here are my two issues with CloudFront at the moment:

  1. Some users it seems to be connecting really slow to my CloudFront CDN. It just hangs. But it's fine for others.

  2. Some users don't even load some files (e.g: stylesheets). But like above, others are fine.

I am regularly making updates to my CDN files and use a query string to tell the users browser that the file has been updated. However I have a query string across the whole website so if I update one files, all files get an updated query string. Could that be the issue?

Has anyone else had issues like this before?

Thanks for your help!


Solution

  • What I have decided to do is remove the use of Query Strings and simply rename the files each time they changed.

    So for example I'd call a file:

    style_23623276323.css

    The "3623276323" part is the MD5 signature of the file.

    More details can be found in this article.

    Hope that helps somebody.