The Blog API uses a two-layer caching strategy to serve blog post data quickly without hitting the upstream source on every request. When the server starts, it attempts to load previously cached data fromDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Project516/BlogAPI/llms.txt
Use this file to discover all available pages before exploring further.
/tmp/cache.json into memory. If that file does not exist, the in-memory cache starts empty. The only way to populate or refresh the cache — whether on a fresh start or after new posts are published — is to call POST /blogs/cache.
How the cache is populated
The cache is built from two sources that work in sequence. On startup, the server reads/tmp/cache.json if it exists and loads its contents into the in-memory cache list:
startup
POST /blogs/cache triggers a live scrape, overwrites the in-memory cache, and writes the result back to /tmp/cache.json:
on-demand refresh
How the scraper works
WhenPOST /blogs/cache is called, the scraper fetches the raw HTML of the upstream blog index from GitHub and parses it with BeautifulSoup. It locates every <article> element in the document, then extracts three pieces of data from each one:
- The text content of the
<h2>tag as the post title - The
hrefattribute of the first<a>tag, prefixed withhttps://project516.dev/ - The
datetimeattribute of the<time>tag as the post date
<a> tag is skipped.
Blog post data shape
Each cached blog post is a JSON object with three fields:blog post object
The text content of the post’s
<h2> element, with surrounding whitespace stripped.The absolute URL to the blog post, constructed by prepending
https://project516.dev/ to the href found in the article’s <a> tag.The
datetime attribute value from the post’s <time> element, typically in YYYY-MM-DD format.When to refresh the cache
You must callPOST /blogs/cache to pick up any new blog posts published to the upstream source. The read endpoints (GET /blogs, GET /blogs/latest, GET /blogs/search) all read directly from the in-memory cache and never trigger a scrape themselves.
refresh the cache
success response
If the server restarts and
/tmp/cache.json is not present — for example, after a system reboot that clears /tmp — the in-memory cache will be empty and all read endpoints will return no data until you call POST /blogs/cache again.