Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using cloudfront function to route to static assets #27

Open
aidan-gee opened this issue Jan 18, 2023 · 2 comments
Open

Using cloudfront function to route to static assets #27

aidan-gee opened this issue Jan 18, 2023 · 2 comments

Comments

@aidan-gee
Copy link

aidan-gee commented Jan 18, 2023

Hi,

I believe it would be cheaper / faster to use a cloudfront function to route to static assets rather than Lambda@edge in some cases. It may be beneficial to have the option to choose

@yarbsemaj
Copy link
Owner

I don't think the origin re-writing would is possible however, i think there may be a way around this. Watch this space!

@falmar
Copy link

falmar commented May 21, 2023

I added 2 origins to cloudfront, one goes to lambda as default behavior (not @edge), changed sveltekit's config.kit.paths.assets to ${ORIGIn}/_assets the second origin has a origin_path of /_asset/* and it routes all static assets to the secondary origin "s3", if i understand correctly this how im serving static files from s3 instead of the lambda function itself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants