Skip to content

Commit 9b9dbad

Browse files
committed
Adds info about visitor scheme vs Origin scheme in Cache Keys
1 parent 03f284f commit 9b9dbad

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/content/docs/cache/how-to/cache-keys.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ It is important to understand how SSL setting changes affect the cache:
5959

6060
This behavior is important to consider when adjusting SSL settings, as any change in the origin scheme (HTTP to HTTPS or vice versa) triggers a cache reset.
6161

62+
#### Visitor scheme vs Origin scheme in Cache Keys
63+
64+
Cloudflare treats `$scheme` differently depending on the cache key type:
65+
66+
* Default Cache Key: `$scheme` refers to the origin scheme — the protocol Cloudflare uses to connect to your origin server (for example, HTTP or HTTPS). This means SSL mode changes (for example, Flexible → Full) change the cache key, triggering a cache bust.
67+
68+
* Custom Cache Key: `$scheme` instead reflects the visitor's scheme — the protocol used by the client making the request to Cloudflare. As a result, SSL mode changes do not affect the cache key in custom configurations unless explicitly included.
69+
6270
### Cache Level: Ignore Query String
6371

6472
A [Cache Level](/cache/how-to/set-caching-levels/) of Ignore Query String creates a Cache Key that includes all the elements in the default cache key, except for the query string in the URI that is no longer included. For instance, a request for `http://example.com/file.jpg?something=123` and a request for `http://example.com/file.jpg?something=789` will have the same cache key, in this case.

0 commit comments

Comments
 (0)