https://github.com/yaodingyd/cf-worker-spa-meta-ssr-template
https://github.com/yaodingyd/cf-worker-spa-meta-ssr-template
Last synced: 24 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/yaodingyd/cf-worker-spa-meta-ssr-template
- Owner: yaodingyd
- Created: 2025-02-23T02:35:44.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-03-02T02:11:35.000Z (over 1 year ago)
- Last Synced: 2025-03-02T03:20:27.625Z (over 1 year ago)
- Language: TypeScript
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CF worker SPA metadata edge rendering template
If you want to improve your single-page-application(SPA)'s SEO and have metadata dynamically rendered per page, you might not need to drastically change the application architecture so you can do full Server-Side-Render(SSR) or use Static-Site-Generation(SSG) for every page of your page. Either way will incur a large technical toll, making the application more difficult to develop or build. Instead, you could take advantage of Cloudflare worker and keep the SPA, only use edge rendering to dynamically change the metadata.
This repo is a template to mostly demonstrate how to achieve this. We only have one function inside worker to serve all static assets. It will try to update the metadata in `index.html` and then serve to client.