Skip to content

Commit 5f5c2ca

Browse files
angelampcostamarciocloudflare
authored andcommitted
[Cache] Update info about impact of SSL settings on Cache behavior (#17057)
* Update info about impact of SSL settings on Cache behavior * Update src/content/docs/ssl/origin-configuration/ssl-modes/index.mdx * Update src/content/docs/cache/how-to/cache-keys.mdx Co-authored-by: marciocloudflare <[email protected]> --------- Co-authored-by: marciocloudflare <[email protected]>
1 parent d63ca5b commit 5f5c2ca

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,21 @@ There are a couple of common reasons to change the Cache Key Template. You might
4141
* Fragment the cache so one URL is stored in multiple files. For example, to store different files based on a specific query string in the URL.
4242
* Consolidate the cache so different HTTP requests are stored in the same file. For example, to remove the Origin header added to Cloudflare Cache Keys by default.
4343

44-
:::note[Note]
44+
### Impact of SSL settings on Cache behavior
4545

46+
The `$scheme` refers to the protocol (HTTP or HTTPS) sent to your origin web server, not the protocol received from the visitor. Therefore, setting the Cloudflare [SSL option](/ssl/origin-configuration/ssl-modes/) influences caching decisions. For example, when using [Flexible SSL](/ssl/origin-configuration/ssl-modes/flexible/), Cloudflare only attempts to connect to your origin web server via HTTP. This means that Cloudflare serves the same cached resource for visitor requests via either HTTP or HTTPS, since Flexible SSL instructs Cloudflare to connect to an origin solely over HTTP.
4647

47-
`$scheme` is the protocol (HTTP or HTTPS) sent to your origin web server and not the protocol received from the visitor. Therefore, setting the Cloudflare [SSL option](/ssl/origin-configuration/ssl-modes/) influences caching decisions. For instance, Cloudflare only attempts to connect to your origin web server via HTTP when [Flexible SSL](/ssl/origin-configuration/ssl-modes/flexible/) is utilized. Thus, Cloudflare serves the same cached resource for visitor requests via either HTTP or HTTPS since Flexible SSL instructs Cloudflare to connect to an origin solely over HTTP.
48+
It is important to understand how SSL setting changes affect the cache:
4849

50+
- Switching from **Off** to **Full**, **Full (strict)**, or **Strict** will change the origin scheme from HTTP to HTTPS. This results in a cache bust, meaning the cached content becomes invalid and needs to be re-fetched from the origin server.
4951

50-
:::
52+
- Transitioning from **Flexible** to **Full**, **Full (strict)**, or **Strict** changes the origin scheme from HTTP to HTTPS, causing a cache bust.
53+
54+
- Downgrading from **Full**, **Full (strict)**, or **Strict** to **Flexible** or **Off** changes the origin scheme from HTTPS to HTTP, resulting in a cache bust.
55+
56+
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.
57+
58+
### Cache Level: Ignore Query String
5159

5260
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.
5361

src/content/docs/ssl/origin-configuration/ssl-modes/index.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ We are gradually rolling out the new [Automated SSL/TLS feature](#automatic-sslt
2727
If your zone has not been migrated yet, you will only have [Custom SSL/TLS](#custom-ssltls) options in your dashboard.
2828
:::
2929

30+
To understand how the various encryption modes affect your cache, refer to the section on [Impact of SSL setting on cache behavior](/cache/how-to/cache-keys/#impact-of-ssl-settings-on-cache-behavior).
31+
3032
### Automatic SSL/TLS (default)
3133

3234
Automatic SSL/TLS uses the [SSL/TLS Recommender](/ssl/origin-configuration/ssl-tls-recommender/) to identify and apply the most secure encryption mode for your website. It continuously assesses your traffic to determine if a more secure option is needed based on your origin certification or capabilities, and updates your settings automatically to ensure the highest level of security for your domain.

0 commit comments

Comments
 (0)