Table of Contents

Enum CacheMode

Namespace
Apizr.Caching
Assembly
Apizr.dll

Define the caching behaviour

public enum CacheMode

Fields

FetchOrGet = 1

Returns fresh data when request succeed otherwise cached one if exist (api data first)

GetOrFetch = 2

Returns cached data if we get some otherwise fresh one if request succeed (cache data first)

None = 0

Returns fresh data when request succeed (api data only)

SetByHeader = 3

Relies on one of the following response header presence, ordered by precedence (otherwise None):

1. Cache-Control (GetOrFetch): Controls how Apizr should cache the data (e.g., max-age, no-store, immutable, etc.).

2. Expires (GetOrFetch): Specifies a date after which Apizr should fetch api data again.

3. ETag (FetchOrGet): Ask Apizr to use the If-None-Match header to check if the data has been modified and handle any 304 Not Modified response.

4. Last-Modified (FetchOrGet): Ask Apizr to use the If-Modified-Since header to check if the resource has been modified and handle any 304 Not Modified response.