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

feat: cache assets in Vercel adapter #7412

Closed
wants to merge 1 commit into from

Conversation

kidonng
Copy link
Contributor

@kidonng kidonng commented Jun 18, 2023

Changes

Add cache headers to assets in Vercel adapter's route config, following Vercel's default config.

This provides better config out of the box and is more consistent with static only builds, which uses Vercel's default config.

Testing

Before: assets are not cached

image

After: assets are strongly cached

image

Docs

@changeset-bot
Copy link

changeset-bot bot commented Jun 18, 2023

⚠️ No Changeset found

Latest commit: d3b92b3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the pkg: integration Related to any renderer integration (scope) label Jun 18, 2023
@@ -151,6 +151,11 @@ export default function vercelEdge({
version: 3,
routes: [
...getRedirects(routes, _config),
{
src: '^/_astro/(.*)$',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The _astro path can be configured through build.assets, it would be nice to derive this string from that too.

@natemoo-re
Copy link
Member

Closing in favor of #7729, but thank you for kicking this off @kidonng!

@natemoo-re natemoo-re closed this Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: integration Related to any renderer integration (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants