1.6 KiB
1.6 KiB
Haiyi Public Site
This repository is the source of truth for the public website on www.haiyihy.com and the H5 pages on h5.haiyihy.com.
Structure
www/: static files served forhttps://www.haiyihy.comh5/: static files served forhttps://h5.haiyihy.comh5/ranking/: Yumi-compatible ranking page usinghttps://jvapi.haiyihy.com
Every page is stored as complete HTML/CSS/JS files in git. There is no JSON-driven page generation step in production anymore.
Edit Workflow
cd public-site
edit www/... or h5/...
git add .
git commit
git push
Production Sync
Production keeps a dedicated clone on the public-site server and syncs it every 20 seconds through systemd:
- server repo:
/opt/haiyihy-public-site/repo - origin runtime:
/opt/haiyihy-public-site/runtime - sync timer:
haiyihy-public-site-sync.timer - source origin domains:
www-origin.haiyihy.comh5-origin.haiyihy.com
The origin server serves static files directly from the git checkout:
repo/www->www.haiyihy.com/www-origin.haiyihy.comrepo/h5->h5.haiyihy.com/h5-origin.haiyihy.com
User-facing traffic goes through Tencent Cloud CDN. CDN pulls from the two *-origin.haiyihy.com domains.
Cache Strategy
- HTML routes: short cache on origin/CDN
- Static assets: long cache on origin/CDN
- Fast bypass:
- append
?t=... - purge in Tencent Cloud International CDN console
- run the purge script:
- append
./deploy/tencent-prod/refresh_public_site_cdn.sh
Bootstrap / Redeploy
./deploy/tencent-prod/redeploy_public_site.sh