Documentation
¶
Overview ¶
Package main demonstrates using graft with node-level caching for HTTP servers.
Nodes declare themselves as cacheable via Cacheable: true. Only cacheable nodes are stored in the cache - request-scoped nodes run fresh every time.
Run this example and make a few requests:
curl http://localhost:8080/user/123 curl http://localhost:8080/user/456 curl http://localhost:8080/admin curl http://localhost:8080/stats
You'll see that config and db (Cacheable: true) execute only ONCE, while request-scoped nodes execute on every request.
Click to show internal directories.
Click to hide internal directories.