How a cached page is served
One idea explained with a decision flow, with its own description for the reader. Sample illustration. Recipe "Blog explanation" in the Recipes guide of the documentation.
How a cached page is served
examples/recipes/blog-explanation/spec.json{
"schemaVersion": 1,
"type": "flow",
"title": "How a cached page is served",
"source": "Illustration for this recipe",
"description": "A request is answered from the cache when the page is there and still fresh; otherwise the server renders it, stores it and answers.",
"width": 1200,
"height": 420,
"flow": {
"nodes": [
{
"id": "request",
"label": "Request arrives",
"kind": "start"
},
{
"id": "lookup",
"label": "In the cache?",
"kind": "decision"
},
{
"id": "fresh",
"label": "Still fresh?",
"kind": "decision"
},
{
"id": "render",
"label": "Render the page"
},
{
"id": "store",
"label": "Store it",
"kind": "store"
},
{
"id": "answer",
"label": "Send the answer",
"kind": "end"
}
],
"edges": [
{
"from": "request",
"to": "lookup"
},
{
"from": "lookup",
"to": "fresh",
"label": "yes"
},
{
"from": "lookup",
"to": "render",
"label": "no"
},
{
"from": "fresh",
"to": "answer",
"label": "yes"
},
{
"from": "fresh",
"to": "render",
"label": "no"
},
{
"from": "render",
"to": "store"
},
{
"from": "store",
"to": "answer"
}
]
},
"mobile": {
"width": 360,
"height": 640
}
}Focus
Source: Illustration for this recipe
Show chart data
| Step | Kind | Leads to |
|---|---|---|
| Request arrives | start | In the cache? |
| In the cache? | decision | Still fresh? (yes), Render the page (no) |
| Still fresh? | decision | Send the answer (yes), Render the page (no) |
| Render the page | step | Store it |
| Store it | data store | Send the answer |
| Send the answer | end |