Skip to main content
43 votes
Accepted

No Cache-Control Header for files from AWS CloudFront with S3 Origin

I've hit a few pages in Google where you can set the Header in S3 for individual objects. That's really not a productive way to do it specially since in my case we are talking of several objects. ...
Michael - sqlbot's user avatar
14 votes
Accepted

Configure AWS Cloudfront to log to S3 bucket in another AWS account

(Updated for future reference) Let's say your CloudFront distribution is in account 123456789012 with logging configured to a bucket your-logging-bucket in a different account. Create a S3 Bucket ...
MLu's user avatar
  • 25.6k
11 votes
Accepted

CDN: How is it possible that my DNS delivers a different IP depending on the visitors location?

Ok it seems I can now give a rough answer to my own question. Anurag Bhatia says that there exist two methods how a CDN works: DNS Have DNS to do the magic i.e when users from network ISP A lookup ...
mgutt's user avatar
  • 532
11 votes
Accepted

Why do CDNs use different domain names rather than subdomains?

While every provider is different and may have different reasons for making the same choices, one common reason this is done is because of Cookies. If your website makes use of cookies and your ...
Moshe Katz's user avatar
  • 3,182
7 votes
Accepted

AWS Cloudfront + Load Balancer, url changes from main domain to load balancer subdomain

This behavior likely results from the fact that by default CloudFront sets the Host: HTTP request header to the origin hostname, in this case elb.example.com. The application then presumably generates ...
Mohamed Heiba's user avatar
7 votes
Accepted

How to prevent DDOS attack impact on Netlify? (downtime + bandwith usage/cost)

Put your server behind a CDN / DDOS protection vendor such as CloudFlare / AWS CloudFront + WAF and ensure that your server only accepts direct connections from your vendor and your own static IP's. ...
Tim's user avatar
  • 33k
5 votes
Accepted

Do I really need cdn for video delivery?

Do I really need cdn for video delivery? "It depends". It depends on where your users are, how many there are of them, what's their concurrency needs, if your infrastructure can deliver what's needed ...
Chopper3's user avatar
  • 102k
4 votes
Accepted

Using CDN like Cloudflare with mod_rewrite to save bandwidth

The easiest way to Cache Everything on a given endpoint in CloudFlare is to use a Cache Everything Page Rule, an asterisk will match a wildcard result. So in your first example we can do the following:...
mjsa's user avatar
  • 395
4 votes
Accepted

Is it optimal to force SSL on my site at CDN, Web Server or Code level?

Do it in Akamai. The closer to the edge your redirect takes place, the faster the request response time will be for your users. https://blogs.akamai.com/2016/02/redirecting-on-the-edge.html If you'...
Steve365's user avatar
  • 1,263
4 votes

CDN: Synchronizing cache across edge machines

I think it would be easier to simply set reasonable Cache-Control: max-age=... headers on the origin responses, than to manually force the caches to refresh certain content. Then, on the nginx caches, ...
guzzijason's user avatar
  • 1,420
4 votes

Does CDN defeat the purpose of server-level GeoIP blocking?

Yes. You need to implement your geo blocking at the CDN level. This usually means paying for the CDN as this is typically not included in free tiers (they'll give you space for a few rules, but the ...
Mark Henderson's user avatar
3 votes
Accepted

Cloudfront returns 403 for a minute after upload

Something is causing your files to be requested from CloudFront before they are present in the bucket. The default configuration of CloudFront causes this to be negatively-cached for up to 5 minutes. ...
Michael - sqlbot's user avatar
3 votes

How to avoid first byte timeout with nginx

A request taking more than 60 seconds is a significant amount of time. You may want to review your application. A page load time that long could have a lot of visitors exiting your app. You may want ...
Gregory Wolf's user avatar
3 votes

Using CDN like Cloudflare with mod_rewrite to save bandwidth

I will start from the end of your question and dig my way up. So first of all, there is no way for proxy (Cloudflare acts like one) to distinguish between static content and the one generated on fly, ...
BorysekOndrej's user avatar
3 votes
Accepted

How is Cache-Control: max-age affected by intermediate caching?

Read this excellent article on cache control headers. One idea is instead of specifying a ten minute caching time you can generate the page to include a precise date/time it expires. After that date/...
Tim's user avatar
  • 33k
3 votes

Can I use the same SSL certificate on the CDN and the origin

Most websites using a CDN make use of a subdomain (e.g. cdn.yourwebsite.com) in order to deliver static assets from. This means that in order to deliver CDN assets over SSL you will need a certificate ...
CodyA's user avatar
  • 131
3 votes

AWS S3, CloudFront, web font CORS error

Are you sure that you are sending Authorization header with your GET requests for the fonts? If not, in your S3 CORS policy change <AllowedHeader>Authorization</AllowedHeader> to &...
pTK's user avatar
  • 131
3 votes

AWS S3, CloudFront, web font CORS error

I was looking for this today and wasn't able to find any working answer for my scenario. I am using wordpress and using s3 bucket based origin push cdn with amazon cloudfront. However the font files ...
Nabeel Khan's user avatar
3 votes
Accepted

Real World Architecture

How do you store the http code? is it stored locally on each machine or on a shared storage? If locally , how do I update the code if the web site changes There's a number of ways, you can store ...
Chopper3's user avatar
  • 102k
3 votes

Cannot Set Up Naked Domain on Azure CDN

This is a common situation with services (not just Azure services) that perform naive DNS checks before allowing you to activate a service. They require a CNAME to be returned, but of course you can't ...
Mark Henderson's user avatar
3 votes
Accepted

Could Cloudflare slow down writing process to database?

Cloudflare sits outside your server, between the user and the web server. The web server (Wordpress on PHP) communicates directly with the database. There is no way Cloudflare is slowing communication ...
Tim's user avatar
  • 33k
3 votes
Accepted

Can CDN caching prevent DoS attacks?

Real visitors browsing your website will only request existing objects that can be cached and which will be served from the CDN caches as long as they don't expire. For that kind of visitor your web ...
Bob's user avatar
  • 6,041
3 votes

hiding sensitive information from cdn provider

https://developers.cloudflare.com/logs/ By default, Cloudflare does not retain your HTTP request logs. However, if you are a Spectrum customer, logs of Spectrum events are retained automatically. ...
diya's user avatar
  • 1,899
3 votes
Accepted

hiding sensitive information from cdn provider

Good practice is not to use a CDN for sensitive information like this. Simple like that. Use another domain (account....) to handle the login as i.e. Microsoft does (login.live.com) and do not run ...
TomTom's user avatar
  • 52k
2 votes

Is it possible to put http torrent tracker under CDN to prevent DDOS?

I'm almost 5 years late, but this is more for people googling. I actually have my tracker behind Cloudflare because it helps with routing traffic for users with IPv6. It helps make sure they're routed ...
goldcard's user avatar
2 votes

Does CURL cache requests?

You can use add a random query string using the $RANDOM environment variable: curl --location --silent "https://git.io/lsf-e2e?$RANDOM" This worked for me on github raw files.
Édouard Lopez's user avatar
2 votes

CloudFront - Users requests static files non-stop to make your bill high?

The answer is a bit dated. In 2017, CloudFront does offer DOS protections through AWS Shield. The Standard tier is offered free to all AWS customers, including CloudFront. For additional features, you ...
Erica Kane's user avatar
2 votes

How to upload files from Amazon EC2 server to S3 bucket?

Using the aws cli commands, if you are using an EC2 Linux virtual machine and want to move files and not directories : aws s3 put <yourfilename> s3://<yourbucketname>/<...
Nicole Douglas's user avatar
2 votes

How to disable Last-Modified and ETag headers in a static website hosted on S3 + CloudFront?

...when you've made a commitment that the URL will always serve the same content body forever. In this case it's often better to force a browser to go straight to its local cache on repeat visits. A ...
Joshua DeWald's user avatar
2 votes
Accepted

Azure File Storage & CDN

You can only access Azure File Storage through SMB or Rest API. That is, without the proper authorization headers, these files are not accessible. If you need anonymous HTTP access or even browser ...
Bruno Faria's user avatar
  • 3,814

Only top scored, non community-wiki answers of a minimum length are eligible