diff --git a/src/content/docs/cache/advanced-configuration/serve-tailored-content.mdx b/src/content/docs/cache/advanced-configuration/serve-tailored-content.mdx index 2d09510086bd1f0..a812bdf7ff02456 100644 --- a/src/content/docs/cache/advanced-configuration/serve-tailored-content.mdx +++ b/src/content/docs/cache/advanced-configuration/serve-tailored-content.mdx @@ -88,7 +88,7 @@ In this example, you run an A/B test controlled by a cookie named `ab-test` (wit 2. Select **Create new Snippet** and name it `ab-test-caching`. 3. Paste the following code. It modifies the cache key based on the `ab-test` cookie and caches the response for 30 days. -```JavaScript +```js const CACHE_DURATION = 30 * 24 * 60 * 60; // 30 days export default { @@ -166,7 +166,7 @@ For complex caching scenarios, [Cloudflare Workers](/cache/interaction-cloudflar This Worker detects whether a visitor is on a mobile or desktop device and creates separate cache entries for each, ensuring the correct version of the site is served and cached. -```JavaScript +```js export default { async fetch(request, env, ctx) { const userAgent = request.headers.get('User-Agent') || ''; @@ -201,7 +201,7 @@ Free and Paid plans This Worker detects if a visitor is on a mobile device or a desktop and creates a separate cache entry for each, ensuring the correct version of the site is served and cached. Uses the Enterprise `cf.customCacheKey` feature. -```JavaScript +```js export default { async fetch(request) { // 1. Determine the device type from the User-Agent header diff --git a/src/content/docs/speed/optimization/protocol/http2-to-origin.mdx b/src/content/docs/speed/optimization/protocol/http2-to-origin.mdx index 61da79a8e36c139..45a3fb12a911fa7 100644 --- a/src/content/docs/speed/optimization/protocol/http2-to-origin.mdx +++ b/src/content/docs/speed/optimization/protocol/http2-to-origin.mdx @@ -1,10 +1,15 @@ --- pcx_content_type: how-to title: HTTP/2 to Origin - --- -import { FeatureTable, Details, Render, APIRequest, Dashboard, DashButton } from "~/components" +import { + FeatureTable, + Details, + Render, + APIRequest, + DashButton, +} from "~/components"; A protocol is a set of rules governing the exchange or transmission of data between devices. One of the most important protocols that run on the human-computer interaction layer, where applications can access the network services, is HTTP (Hypertext Transfer Protocol). @@ -24,7 +29,7 @@ If you wish to disable HTTP/2 to Origin, you can follow these steps: -4. Go to the **Protocol Optimization** tab and under **HTTP/2 to Origin** set the toggle to **Off**. +2. Go to the **Protocol Optimization** tab and under **HTTP/2 to Origin** set the toggle to **Off**. ## Connection multiplexing @@ -39,7 +44,7 @@ Connection multiplexing is enabled by default on Free, Pro and Business zones an 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login) and select your account. 2. Choose the domain that will use HTTP/2 to Origin. 3. Select **Speed > Optimization**. -4. Open the **Protocol Optimization** tab. +4. Open the **Protocol Optimization** tab. 5. Under **HTTP/2 to Origin**, select **Configure** and adjust the stream settings as needed. @@ -47,13 +52,13 @@ Connection multiplexing is enabled by default on Free, Pro and Business zones an
- + Refer to the [API documentation](/api/python/resources/zones/subresources/settings/methods/edit/) for more information.