Skip to content

Commit 986373c

Browse files
Merge branch 'production' of github.com:cloudflare/cloudflare-docs into production
2 parents 1c9dea5 + 7b50972 commit 986373c

File tree

45 files changed

+899
-262
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+899
-262
lines changed
-20.6 KB
Binary file not shown.
-175 KB
Binary file not shown.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: Run AI-generated code on-demand with Code Sandboxes (new)
3+
description: You can start creating sandboxes today by installing our new Sandbox package.
4+
products:
5+
- agents
6+
- workers
7+
- workflows
8+
date: 2025-06-25T15:00:00Z
9+
---
10+
11+
AI is supercharging app development for everyone, but we need a safe way to run untrusted, LLM-written code. We’re introducing [Sandboxes](https://www.npmjs.com/package/@cloudflare/sandbox), which let your Worker run actual processes in a secure, container-based environment.
12+
13+
```ts
14+
import { getSandbox } from "@cloudflare/sandbox";
15+
export { Sandbox } from "@cloudflare/sandbox";
16+
17+
export default {
18+
async fetch(request: Request, env: Env) {
19+
const sandbox = getSandbox(env.Sandbox, "my-sandbox");
20+
return sandbox.exec("ls", ["-la"]);
21+
},
22+
};
23+
```
24+
25+
### Methods
26+
27+
- `exec(command: string, args: string[], options?: { stream?: boolean })`:Execute a command in the sandbox.
28+
- `gitCheckout(repoUrl: string, options: { branch?: string; targetDir?: string; stream?: boolean })`: Checkout a git repository in the sandbox.
29+
- `mkdir(path: string, options: { recursive?: boolean; stream?: boolean })`: Create a directory in the sandbox.
30+
- `writeFile(path: string, content: string, options: { encoding?: string; stream?: boolean })`: Write content to a file in the sandbox.
31+
- `readFile(path: string, options: { encoding?: string; stream?: boolean })`: Read content from a file in the sandbox.
32+
- `deleteFile(path: string, options?: { stream?: boolean })`: Delete a file from the sandbox.
33+
- `renameFile(oldPath: string, newPath: string, options?: { stream?: boolean })`: Rename a file in the sandbox.
34+
- `moveFile(sourcePath: string, destinationPath: string, options?: { stream?: boolean })`: Move a file from one location to another in the sandbox.
35+
- `ping()`: Ping the sandbox.
36+
37+
Sandboxes are still experimental. We're using them to explore how isolated, container-like workloads might scale on Cloudflare — and to help define the developer experience around them.
38+
39+
You can try it today from your Worker, with just a few lines of code. Let us know what you build.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Improved non-English keyboard support
3+
description: Introduced support for non-English keyboard configurations in the remote browser, enhancing the global user experience.
4+
date: 2024-11-21
5+
---
6+
7+
You can now type in languages that use diacritics (like á or ç) and character-based scripts (such as Chinese, Japanese, and Korean) directly within the remote browser. The isolated browser now properly recognizes non-English keyboard input, eliminating the need to copy and paste content from a local browser or device.

src/content/changelog/dns/2025-06-23-account-level-dns-analytics-api.mdx

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,29 @@ Authoritative DNS analytics are now available on the **account level** via the [
88

99
This allows users to query DNS analytics across multiple zones in their account, by using the `accounts` filter.
1010

11-
Here is an example to retrieve all DNS queries across all zones in an account that resulted in an `NXDOMAIN` response over a given time frame. Please replace `a30f822fcd7c401984bf85d8f2a5111c` with your actual account ID.
11+
Here is an example to retrieve the most recent DNS queries across all zones in your account that resulted in an `NXDOMAIN` response over a given time frame. Please replace `a30f822fcd7c401984bf85d8f2a5111c` with your actual account ID.
1212

1313
```graphql graphql-api-explorer title="GraphQL example for account-level DNS analytics"
14-
query Viewer {
15-
viewer {
16-
accounts(filter: { accountTag: "a30f822fcd7c401984bf85d8f2a5111c" }) {
17-
dnsAnalyticsAdaptive(
18-
limit: 10
19-
filter: { date_geq: "2025-06-16", responseCode: "NXDOMAIN", date_leq: "2025-06-18" }
20-
orderBy: [datetime_DESC]
21-
) {
22-
zoneTag
23-
queryName
24-
responseCode
25-
queryType
26-
datetime
27-
}
28-
}
29-
}
14+
query GetLatestNXDOMAINResponses {
15+
viewer {
16+
accounts(filter: { accountTag: "a30f822fcd7c401984bf85d8f2a5111c" }) {
17+
dnsAnalyticsAdaptive(
18+
filter: {
19+
date_geq: "2025-06-16",
20+
date_leq: "2025-06-18",
21+
responseCode: "NXDOMAIN"
22+
}
23+
limit: 10000
24+
orderBy: [datetime_DESC]
25+
) {
26+
zoneTag
27+
queryName
28+
responseCode
29+
queryType
30+
datetime
31+
}
32+
}
33+
}
3034
}
3135
```
3236

src/content/docs/browser-rendering/rest-api/pdf-endpoint.mdx

Lines changed: 47 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,28 @@ sidebar:
77

88
import { Tabs, TabItem } from "~/components";
99

10-
The `/pdf` endpoint instructs the browser to render the webpage as a PDF document.
10+
The `/pdf` endpoint instructs the browser to generate a PDF of a webpage or custom HTML using Cloudflare's headless browser rendering service.
11+
12+
## Endpoint
13+
14+
```txt
15+
https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-rendering/pdf
16+
```
17+
18+
## Required fields
19+
You must provide either `url` or `html`:
20+
- `url` (string)
21+
- `html` (string)
22+
23+
## Common use cases
24+
25+
- Capture a PDF of a webpage
26+
- Generate PDFs, such as invoices, licenses, reports, and certificates, directly from HTML
1127

1228
## Basic usage
1329

30+
### Convert a URL to PDF
31+
1432
<Tabs syncKey="workersExamples"> <TabItem label="curl">
1533

1634
Navigate to `https://example.com/` and inject custom CSS and an external stylesheet. Then return the rendered page as a PDF.
@@ -51,11 +69,35 @@ console.log(content);
5169

5270
</TabItem> </Tabs>
5371

72+
### Convert custom HTML to PDF
73+
74+
If you have raw HTML you want to generate a PDF from, use the `html` option. You can still apply custom styles using the `addStyleTag` parameter.
75+
76+
```bash
77+
curl -X POST https://api.cloudflare.com/client/v4/accounts/<acccountID>/browser-rendering/pdf \
78+
-H 'Authorization: Bearer <apiToken>' \
79+
-H 'Content-Type: application/json' \
80+
-d '{
81+
"html": "<html><body>Advanced Snapshot</body></html>",
82+
"addStyleTag": [
83+
{ "content": "body { font-family: Arial; }" },
84+
{ "url": "https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" }
85+
]
86+
}' \
87+
--output "invoice.pdf"
88+
```
89+
5490
## Advanced usage
5591

56-
Navigate to `https://example.com`, first setting an additional HTTP request header and configuring the page size (`viewport`). Then, wait until there are no more than 2 network connections for at least 500 ms, or until the maximum timeout of 4500 ms is reached, before considering the page loaded and returning the rendered PDF document.
92+
:::note[Looking for more parameters?]
93+
Visit the [Browser Rendering PDF API reference](/api/resources/browser_rendering/subresources/pdf/methods/create/) for all available parameters, such as setting HTTP credentials using `authenticate`, setting `cookies`, and customizing load behavior using `gotoOptions`.
94+
:::
95+
96+
### Advanced page load with custom headers and viewport
5797

58-
The `goToOptions` parameter exposes most of [Puppeteer'd API](https://pptr.dev/api/puppeteer.gotooptions).
98+
Navigate to `https://example.com`, setting additional HTTP headers and configuring the page size (viewport). The PDF generation will wait until there are no more than two network connections for at least 500 ms, or until the maximum timeout of 4500 ms is reached, before rendering.
99+
100+
The `goToOptions` parameter exposes most of [Puppeteer's API](https://pptr.dev/api/puppeteer.gotooptions).
59101

60102
```bash
61103
curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-rendering/pdf' \
@@ -78,9 +120,9 @@ curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-
78120
--output "advanced-output.pdf"
79121
```
80122

81-
## Blocking images and styles when generating a PDF
123+
### Blocking images and styles when generating a PDF
82124

83-
The options `rejectResourceTypes` and `rejectRequestPattern` can be used to block requests. The opposite can also be done, _only_ allow certain requests using `allowResourceTypes` and `allowRequestPattern`.
125+
The options `rejectResourceTypes` and `rejectRequestPattern` can be used to block requests during rendering. The opposite can also be done, _only_ allow certain requests using `allowResourceTypes` and `allowRequestPattern`.
84126

85127
```bash
86128
curl -X POST https://api.cloudflare.com/client/v4/accounts/<acccountID>/browser-rendering/pdf \
@@ -93,23 +135,3 @@ curl -X POST https://api.cloudflare.com/client/v4/accounts/<acccountID>/browser-
93135
}' \
94136
--output "cloudflare.pdf"
95137
```
96-
97-
## Generate PDF from custom HTML
98-
99-
If you have HTML you'd like to generate a PDF from, the `html` option can be used. The option `addStyleTag` can be used to add custom styles.
100-
101-
```bash
102-
curl -X POST https://api.cloudflare.com/client/v4/accounts/<acccountID>/browser-rendering/pdf \
103-
-H 'Authorization: Bearer <apiToken>' \
104-
-H 'Content-Type: application/json' \
105-
-d '{
106-
"html": "<html><body>Advanced Snapshot</body></html>",
107-
"addStyleTag": [
108-
{ "content": "body { font-family: Arial; }" },
109-
{ "url": "https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" }
110-
]
111-
}' \
112-
--output "invoice.pdf"
113-
```
114-
115-
Many more options exist, like setting HTTP credentials using `authenticate`, setting `cookies`, and using `gotoOptions` to control page load behaviour - check the endpoint [reference](/api/resources/browser_rendering/subresources/pdf/methods/create/) for all available parameters.

src/content/docs/cache/concepts/cache-control.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,10 @@ Certain scenarios also affect Origin Cache Control behavior when it is enabled o
196196
</tbody>
197197
</table>
198198

199+
:::note
200+
When the `Cloudflare-Cdn-Cache-Control` header is set, OCC is turned **on** (regardless of whether OCC is enabled or disabled). As a result, we apply our Authorization header logic (per [RFC 7234, Section 3.2](https://tools.ietf.org/html/rfc7234#section-3.2)) to allow only the `s-maxage`, `must-revalidate`, or `public` directives. If any other directive is present, we do not cache the asset and instead return `BYPASS`.
201+
:::
202+
199203
## Examples
200204

201205
Review the examples below to learn which directives to use with the `Cache-Control` header to control specific caching behavior.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: 5 - Junk email folder and administrative quarantine
3+
pcx_content_type: integration-guide
4+
sidebar:
5+
order: 5
6+
head:
7+
- tag: title
8+
content: Deliver emails to the junk email folder - Office 365
9+
10+
---
11+
12+
import { Render } from "~/components"
13+
14+
In this tutorial, you will learn to deliver `SUSPICIOUS` and `BULK` messages to the user's junk email folder, and `MALICIOUS`, `SPAM`, and `SPOOF` messages to the Administrative Quarantine (this requires an administrator to release the emails).
15+
16+
## Configure anti-spam policies
17+
18+
<Render file="email-security/deployment/m365-use-cases-antispam" params={{ one: "_AdminOnlyAccessPolicy_", two: "_AdminOnlyAccessPolicy_", three: "_AdminOnlyAccessPolicy_", four: "step7-adminonly-case5.png" }} />
19+
20+
## Create transport rules
21+
22+
<Render file="email-security/deployment/m365-use-case-transport-rules" params={{ one: "Email Security Deliver to Junk Email folder`", two: "`SUSPICIOUS`, `BULK`", three: "_Modify the message properties_ > _Set the Spam Confidence Level (SCL)_ > _5_", four: "step4-rules.png", five: "`Email Security Admin Managed Host Quarantine`", six: " `MALICIOUS`, `UCE`, `SPOOF`", seven: "_Redirect the message to_ > _hosted quarantine_", eight: "step10-hosted-quarantine-case5.png" }} />
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
title: 4 - User managed quarantine and administrative quarantine
3+
pcx_content_type: integration-guide
4+
sidebar:
5+
order: 4
6+
head:
7+
- tag: title
8+
content: User managed quarantine and administrative quarantine - Office 365
9+
10+
---
11+
12+
import { Render } from "~/components"
13+
14+
In this tutorial, you will learn to deliver `SPAM` and `SPOOF` messages to the user managed quarantine, and `MALICIOUS` messages to the administrative quarantine (this requires an administrator to release the emails).
15+
16+
## Create quarantine policies
17+
18+
<Render file="email-security/deployment/m365-use-case-2-4-create-quarantine-policy" />
19+
20+
## Configure quarantine notifications
21+
22+
<Render file="email-security/deployment/m365-use-case-configure-quarantine-notifications" />
23+
24+
## Configure anti-spam policies
25+
26+
To configure anti-spam policies:
27+
28+
1. Open the [Microsoft 365 Defender console](https://security.microsoft.com/)
29+
30+
2. Go to **Email & collaboration** > **Policies & rules**.
31+
32+
3. Select **Threat policies**.
33+
34+
4. Under **Policies**, select **Anti-spam**.
35+
36+
5. Select the **Anti-spam inbound policy (Default)** text (not the checkbox).
37+
38+
6. In the **Actions** section, scroll down and select **Edit actions**.
39+
40+
7. Set the following conditions and actions (you might need to scroll up or down to find them):
41+
42+
* **Spam**: *Quarantine message*.
43+
* **Select quarantine policy**: *UserNotifyUserRelease*.
44+
* **High confidence spam**: *Quarantine message*.
45+
* **Select quarantine policy**: *UserNotifyAdminRelease*.
46+
* **Phishing**: *Quarantine message*.
47+
* **Select quarantine policy**: *UserNotifyAdminRelease*.
48+
* **High confidence phishing**: *Quarantine message*.
49+
* **Select quarantine policy**: *UserNotifyAdminRelease*.
50+
* **Retain spam in quarantine for this many days**: Default is 15 days. Email Security recommends 15-30 days.
51+
52+
8. Select **Save**.
53+
54+
## Create transport rules
55+
56+
<Render file="email-security/deployment/m365-use-case-transport-rules" params={{ one: "`Email Security User Quarantine Message`", two: "`UCE`, `SPOOF`", three: "_Modify the message properties_ > _Set the Spam Confidence Level (SCL)_ > _5_", four: "step4-rules-case4.png", five: "`Email Security User Quarantine Message Admin Release`", six: "`MALICIOUS`", seven: "_Modify the message properties_ > _Set the Spam Confidence Level (SCL)_ > _9_", eight: "step10-admin-release-case4.png" }} />

0 commit comments

Comments
 (0)