Documentation
¶
Overview ¶
Package newslab is NewsLab, a news site: HTML home, section and article pages, an RSS feed and a JSON API, behind a page cache of the kind a CDN or reverse proxy provides (Cache-Control, ETag, Age and X-Cache headers, conditional requests). Pages are rendered by a small origin that can render four at a time. It is the reference app for the content pack.
Planted bottlenecks (see README.md), each switched off by a fix flag:
- stampede: when a page is not cached, every request for it renders it, so a popular page that expires or is purged sends a crowd to the origin at once (fix "stampede" lets one request render while the others wait for its result).
- purge: publishing an article empties the whole cache, so every update during breaking news makes the site cold (fix "purge" removes only the pages the article appears on).
- cachekey: the cache key is the full URL, tracking parameters included, so readers arriving from social links (utm_source, fbclid ...) never hit the cache (fix "cachekey" drops tracking parameters and sorts the rest).
Index ¶
Constants ¶
View Source
const ( // Articles is how many articles NewsLab starts with (story-00001 ...). Articles = 20000 // EditorToken is the bearer token the newsroom publishes with. EditorToken = "newslab-editor" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.