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

Use CDN to serve files in site folder referenced by template #885

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

davidmerfield
Copy link
Owner

@davidmerfield davidmerfield commented Mar 13, 2025

The problem is file serving from the EBS disk via node is really slow.

The goal is to avoid people putting fonts in their site folder then embedding them in a template. We want these requests to go through the CDN where possible

  • We could do something at the render middleware which retrieved a full list of folder urls and if there's a match, add the cdn origin and a hash parameters
    • maybe use a fast html parser (parse5?) rather than a regex
    • to make this work we maybe need to use the metadata model to store a modified time, content hash, etc
  • Ensure the correct access control origin headers are set by the CDN for these files so fonts still work

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

Successfully merging this pull request may close these issues.

1 participant