chartletv0.21.0

← All examples

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
How a cached page is served
How a cached page is servedA request is answered from the cache when the page is there and still fresh; otherwise the server renders it, stores it and answers.Request arrives → In the cache?In the cache? → Still fresh?: yesIn the cache? → Render the page: noStill fresh? → Send the answer: yesStill fresh? → Render the page: noRender the page → Store itStore it → Send the answeryesnoyesnoRequest arrivesRequest arrivesIn the cache?In the cache?Still fresh?Still fresh?Render the pageRender the pageStore itStore itSend the answerSend the answer
How a cached page is servedA request is answered from the cache when the page is there and still fresh; otherwise the server renders it, stores it and answers.Request arrives → In the cache?In the cache? → Still fresh?: yesIn the cache? → Render the page: noStill fresh? → Send the answer: yesStill fresh? → Render the page: noRender the page → Store itStore it → Send the answeryesnoyesnoRequest arrivesRequestarrivesIn the cache?In the cache?Still fresh?Still fresh?Render the pageRender thepageStore itStore itSend the answerSend theanswer

Source: Illustration for this recipe

Show chart data
Data for How a cached page is served
StepKindLeads to
Request arrivesstartIn the cache?
In the cache?decisionStill fresh? (yes), Render the page (no)
Still fresh?decisionSend the answer (yes), Render the page (no)
Render the pagestepStore it
Store itdata storeSend the answer
Send the answerend
  • Blog explanation
  • Flow chart
  • HTML with table, narrow screen