amazon-cloudfront

Cloudfront Origin Group detect failver using Lambda@Edge

℡╲_俬逩灬. 提交于 2020-01-24 20:55:47
问题 My setup: I have a Cloudfront Origin Group where Bucket A is a primary bucket and Bucket B is a secondary bucket. Lambda@Edge is added on origin-request to do a certain process. Whenever a request comes to Cloudfront, my Lambda@Edge modifies it to match the folder structure of my bucket and returns file accordingly. If Bucket A doesn't have a certain file it throws an error and Cloudfront failover requests the file from Bucket B. Bucket B doesn't have the same structure as Bucket it, it

Cloudfront and CSS/JS assets

99封情书 提交于 2020-01-23 13:09:35
问题 I have a cloudfront distribution set up to go to myapp.herokuapp.com Maybe I've misunderstood Cloudfront and CDNs in general, but I thought that somehow the CDN hosted the static files instead of me just including references to the CDN URL in my HTML files stored on Heroku. What I'm seeing in my Chrome Network tab is: Request URL:http://blah123.cloudfront.net/css/style-123.css Request Method:GET Status Code:301 Moved Permanently then: Request URL:http://myapp.herokuapp.com/css/style-123.css

How to invalidate CloudFront cache of dynamic content when content is updated

喜夏-厌秋 提交于 2020-01-23 10:58:11
问题 I am developing Web APIs using AWS Lambda, API Gateway and CloudFront. CloudFront is currently used as reverse proxy to some endpoints of API Gateway, cache behaviors are disabled at all. There are several frequently-used APIs, of which contents are rarely-updated (e.g. once a week or once a month) , therefore are candidates for caching for faster response time. However, I am wondering how to invalidate such CloudFront cache of frequently-used-but-rarely-updated dynamic content when their

How to invalidate CloudFront cache of dynamic content when content is updated

泄露秘密 提交于 2020-01-23 10:56:09
问题 I am developing Web APIs using AWS Lambda, API Gateway and CloudFront. CloudFront is currently used as reverse proxy to some endpoints of API Gateway, cache behaviors are disabled at all. There are several frequently-used APIs, of which contents are rarely-updated (e.g. once a week or once a month) , therefore are candidates for caching for faster response time. However, I am wondering how to invalidate such CloudFront cache of frequently-used-but-rarely-updated dynamic content when their

AWS CloudFront access denied to S3 bucket

送分小仙女□ 提交于 2020-01-22 05:13:08
问题 I am trying to setup CloudFront to serve static files hosted in my S3 bucket. I have setup distribution but I get AccessDenied when trying to browse to the CSS ( /CSS/stlyle.css ) file inside S3 bucket: <Error> <Code>AccessDenied</Code> <Message>Access Denied</Message> <RequestId>E193C9CDF4319589</RequestId> <HostId> xbU85maj87/jukYihXnADjXoa4j2AMLFx7t08vtWZ9SRVmU1Ijq6ry2RDAh4G1IGPIeZG9IbFZg= </HostId> </Error> I have set my CloudFront distribution to my S3 bucket and created new Origin

Steps to deploy a React app on S3 with CloudFront while managing caching?

别说谁变了你拦得住时间么 提交于 2020-01-19 15:05:13
问题 I need to deploy a React App on AWS S3 using SSL and managing caching. What are the required steps, and what are some of the problems I might encounter? 回答1: Why do this? It can be incredibly fast, "serverless" and very inexpensive. Through the CloudFront global endpoints (edge locations), an application can run very quickly with high reliability. By setting another source origin, CloudFront can act as a reverse proxy to an API, eliminating cross-region (CORS) issues and accelerating API

Why doesn't CloudFront return the cached version of these identical URL's?

随声附和 提交于 2020-01-16 18:33:47
问题 I have a server on eb (running a tomcat application), I also have a CloudFront cache setup to cache duplicate requests so that they dont go to the server. I have two behaviours set up /artist/search /Default(*) and Default(*) is set to: Allowed Http Methods :GET,PUT Forward Headers :None Headers :Customize Timeout :84,0000 Forward Cookies :None Forward Query Strings :Yes Smooth Streaming :No Restricted View Access:No so there is no timeout and the only thing it forwards are queries strings

Are Get request with body allowed on AWS? 403 error from CloudFront

孤街醉人 提交于 2020-01-16 14:49:30
问题 I published an api to AWS with Visual Studio and using the template for AWS Serverless application project, for now I am testing the methods with postman, but all get methods that require a body are returning an error that mentions cloudfront in the response, I do not know if the issue is related to cloudfront or if it is the AWS HTTP 1.1 specification implementation that does not allow get requests with body: Note:Get requests with body were a requirement from our client RFC 7231 HTTP/1.1

How to invalidate a file(to be refreshed) served from Cloudfront CDN via Java AWS SDK?

大憨熊 提交于 2020-01-14 10:49:28
问题 I am using Java SDK to uploaded images to S3, How do I invalidate a file in CloudFront so that it is refetched from s3 origin. How to do it via Java SDK ? 回答1: import com.amazonaws.services.cloudfront; import com.amazonaws.services.cloudfront.model.CreateInvalidationRequest; import com.amazonaws.services.cloudfront.model.Paths; import com.amazonaws.services.cloudfront.model.InvalidationBatch; import com.amazonaws.auth.DefaultAWSCredentialsProviderChain; AWSCredentials awsCredentials = new

How to solve “x-cache: Error from cloudfront” on SPA

倖福魔咒の 提交于 2020-01-14 03:17:30
问题 We are having issues trying to make working a SPA with a client router (react router). We are using the concept of have a DOMAIN -> CDN (CloudFront) -> S3 for serving our static files. We have configured the S3 for serving static files. The CDN are configured to have the origin from the S3 and we have configured custom error pages to catch errors: with this configuration we can catch errors like this: https://www.example.com/custom-url The CDN will redirect all the 404/403 errors to the main