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

move to fastly #67

Merged
merged 6 commits into from
Mar 29, 2024
Merged

move to fastly #67

merged 6 commits into from
Mar 29, 2024

Conversation

NeilHanlon
Copy link
Member

@NeilHanlon NeilHanlon commented Feb 24, 2024

We've been experiencing issues for the past few months due to bandwidth being served by Vercel for the docs.rockylinux.org site. Investigation by the Web team isolated it to mainly the search indicies on the docs website. These are fairly large and, apparently not being cached by Vercel.

Fastly is a very easy choice for hosting the docs site as it is truly static and can be hosted alongside the rest of our services.

This change implements a compute-js service using compute-js-static-public. There are a couple modifications/customizations:

  1. allow custom cache control settings for requests
  2. fix: allow for dots in KV Store name

Compiled/built versions of the above are hosted on git.resf.org and will be pulled from there during the build process.

In addition to the above external changes, the compute-js application source was modified such that localized content (i.e., non-english) is served from Vercel. This is achieved by the following logic implemented in the code:

  1. If a request contains a locale in the path, attempt to serve the page from the compute-js application. There is a regex which defines this match, which was generated from the mkdocs.yml from HEAD, and is current.
  2. If we cannot find the content locally, attempt to fetch it from Vercel. Return this response if it is not an error from Vercel.
  3. If the request did not have a locale slug in it, try to fetch it from the compute-js application.
  4. If it does not exist, try to fetch it from Vercel -- this is to cover static assets which are requested when rendering the DOM for the Vercel page returned by step 2.
  5. If we still have not found the object, return a 404.

n.b. This change does not modify the DNS for docs.rockylinux.org, but will enable us to cut over to Fastly to serve this content in the future, while deploying the content side-by-side with the Vercel version.

Copy link

vercel bot commented Feb 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rockylinux-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 29, 2024 5:34pm

@NeilHanlon NeilHanlon changed the title WIP: move to fastly move to fastly Mar 20, 2024
@NeilHanlon NeilHanlon marked this pull request as ready for review March 20, 2024 03:26
- set unique surrogate key for vercel-hosted content being served
- pay no attention to the insanity that now will become fastly.toml.
- set surrogate key for vercel content
- disable font: false
- strip non-EN for now
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