- 🚀 Development
- 🏗️ Project and page structure
- 🗺️ System architecture
- 🛠️ Technical choice
- ⚡ A note on cache behavior
- ⚡ A note on sitemap
- 📄 License
Note: We do not plan to add external maintainer yet!
- Staging deployment: https://dev.collection.news
- Production deployment: https://collection.news
npm install
cp .env.example .env.local
- Request AWS access from team members
- Fill up the ENV marked
<required>
in your .env.local
npm run dev
- 昔日新聞 - News for that date sort by time desc
/<media_slug>/<date_slug>
/<media_slug>/<date_slug>/<category_slug>
- Pseudo SQL
SELECT * FROM
appledaily_tableWHERE date = '20190721' AND category = 'local;
- 當年今日 - News on today for past year
/<media_slug>/history/<year_slug>/
/<media_slug>/history/<year_slug>/<category_slug>
- Pseudo SQL
SELECT * FROM
appledaily_tableWHERE date = '20190721' AND category = 'local';
- 內文 - Article content
/<media_slug>/articles/<article_id>/
- Home page
/
- Search page
/search
- Not fully functional yet due to Google indexing mechanism
- NextJS & React with ISR
- AWS
- Cloudflare
- Vercel
- S3 object have
cache-control: max-age=31536000,public,immutable
- Cloudfront (asset)
min_ttl=2629743
default_ttl=31536000
max_ttl=31536000
- For more details on Cloudfront cache behavior, please refer to official documentation
- NextJS rendered HTML have
cache-control: public, max-age=0, must-revalidate
header but NextJS server side will cache SSR result depends onrevalidate
field. Currently it is indefinitely (until next deployment) for article page and 1 hour other listing page. - Article API have
cache-control: public, max-age=604800, s-maxage=604800, immutable
header, i.e. 7 days client side cache, too. - Cloudflare applied "Cache Everything" rule with
cdn.collection.news
Edge Cache TTL: a month and,collection.news
Edge Cache TTL: 2 hours
- Sitemap index is generated at build time in
prebuild
script. - Site map logic are inside
src/scripts/genSitemap.ts
&src/pages/api/sitemap/[media]/[date].ts
.next.config.js
will do the mapping for dynamic sitemap generation. - Root sitemap index (
/sitemap.xml
) contain links to all sitemap group by date. e.g./sitemap/appledaily/20210623.xml
This software is released under the MIT License in GitHub. Logo the on this site is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0). Next Digital Ltd. maintain the copyright of all the content of Apply Daily. Best Pencil (Hong Kong) Ltd. maintain the copyright of all the content of Stand News. For enquiries, please contact us at info@collection.news.
本軟件在 MIT 許可證下發佈在GitHub,而本網站上的徽標根據創用CC 姓名標示-非商業性-相同方式分享 4.0 國際 (CC BY-NC-SA 4.0)分享。「壹傳媒有限公司」保留《蘋果日報》所有內容的版權。「立場新聞信託」保留《立場新聞》所有內容的版權。如有查詢,請聯絡我們 info@collection.news。