Replies: 0 comments 7 replies
-
Note-to-self; When we build all of |
Beta Was this translation helpful? Give feedback.
-
One advantage of not letting CloudFront do its own S3 lookup and hardcoded 404 handling is that we could manage that ourselves. I.e. If the request came in for |
Beta Was this translation helpful? Give feedback.
-
With our current Jamstack approach, launching new content and launching new functionality (CSS, JS, logos) is tied to run on the same exact cadence. Suppose we disconnect these, we could launch a new CSS change more or less as soon as it hits |
Beta Was this translation helpful? Give feedback.
-
Suppose we make our
|
Beta Was this translation helpful? Give feedback.
-
Another not-so-crazy thing is that if we could NOT worry about SSR rendering, but only generate the |
Beta Was this translation helpful? Give feedback.
-
What could be possible downsides? |
Beta Was this translation helpful? Give feedback.
-
To get fully rendered HTML to the client, you have to do some sort of "server-side rendering". Aka. SSR.
It basically involves Node rendering some content structs with some React code through. I.e.
import { renderToString } from "react-dom/server";
But it's also about doing all sorts of other stuff with the HTML which we use
cheerio
for. We basically take the HTML string fromrenderToSstring()
, combine it with anindex.html
template, and then usecheerio
to mutate pieces of it and finally, return the fully formed HTML.What I'm wondering is; how about we stop building the HTML as a cronjob build step in GitHub Actions and instead do it in a web server running Node. Runtime SSR rendering. We'll still build all the content (as
index.json
files) in a build-step and have that uploaded to some storage service.This is almost how the old Kuma front-end used to work. Except it would do everything at runtime except kumascript rendering because the kumascript rendering is done once and its results stored in MySQL.
The advantage of still building all the content (i.e. producing the
index.json
and_samples/index.html
) files is that you can then get a complete picture of what all the content is. So you can produce things likesitemaps.xml
andsearch-index.json
and it also gives you a complete bundle for uploading to Elasticsearch. And having a complete build of everything that can be built you can know what is now leftover waste (e.g. pruning).Let's not talk about Django vs. Express or Kubernetes vs. serverless. But one thing I'd be very much interested in is to make the CDN a lot different by having all traffic routed back to a custom backend. (That backend could be Lambda@Edge!) That backend then gets a URL and if the URL is something like
/en-US/docs/Web/Foo
it, in run-time, goes to download the<bucketURL>/main/en-us/docs/web/foo/index.json
and then uses that to run what is todayssr/index.js
and then returns the fully formed HTML plus an aggressive (~1day)Cache-Control
so it doesn't have to do that again for a while.Beta Was this translation helpful? Give feedback.
All reactions