Skip to content

Use Cloudflare Cache #83

Description

@NNTin

not a problem (yet) but still noting it down to keep it in mind.

Our renderer service already caches the renderer, however they still need to be served. A new web client visiting the index will request X layouts and thus X thumbnails. If Y new web clients connect this becomes a X*Y problem basically resulting in a self-ddos.
This also becomes a problem when there is e.g. a christmas, halloween edition update. Then suddenly many users will have a cache miss and request new images.

Instead of

100 clients
    │
    ├──► home server
    ├──► home server
    ├──► home server
    ├──► home server
    └──► home server

We need the setup

                  ┌───────────────┐
Client A ────────►│               │
Client B ────────►│   Cloudflare  │
Client C ────────►│     Cache     │
Client D ────────►│               │
                  └───────┬───────┘
                          │
                 only cache MISS
                          │
                          ▼
                   ┌─────────────┐
                   │ Home Server │
                   │  via Tunnel │
                   └─────────────┘

Essentially mirroring this setup:

flowchart LR
    A[Client / Browser] --> B[Cloudflare Edge]
    B --> C{Image in Cache?}

    C -->|Yes - HIT| D[Return Cached Image]
    D --> A

    C -->|No - MISS| E[Cloudflare Tunnel]
    E --> F[Home Web Server]
    F --> E
    E --> B

    B --> G[Store Image in Cloudflare Cache]
    G --> A
Loading

Currently we are serving

/images/logo.jpg
/images/product.jpg
/images/banner.jpg

this should become

/images/logo-a81f32.jpg
/images/product-71c923.jpg
/images/banner-93bc11.jpg

Reason: Version updates to the renderer should serve the new layouts immediately instead of waiting for the layout images to become expired.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions