Skip to content

Commit a336dc2

Browse files
authored
cdn purge (#233)
1 parent 6c34519 commit a336dc2

File tree

4 files changed

+106
-3
lines changed

4 files changed

+106
-3
lines changed

apps/docs/content/features/cdn.mdx

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,30 @@ You should consider purging cached content when:
186186

187187
### Purging Cached Content
188188

189-
Zerops provides a simple [API](#api-reference) to manage and purge cached content before its normal expiration. You can use wildcard patterns to target specific content sets:
189+
Zerops provides multiple ways to manage and purge cached content before its normal expiration:
190+
191+
- **Command Line**: Use the `zsc cdn purge` [command](/references/zsc#cdn) available in all Zerops containers:
192+
```sh
193+
# Purge all content for a domain
194+
zsc cdn purge example.com
195+
196+
# Purge specific path
197+
zsc cdn purge example.com /images/
198+
```
199+
200+
- **API Endpoints**: For programmatic control, use the [API endpoints](#api-reference). Here are ready-to-use curl examples for quickly purging content in your scripts:
201+
202+
```sh
203+
# Static mode: Purge all content for a domain
204+
curl --location --request PUT "https://api.app-prg1.zerops.io/api/rest/public/project/$PROJECT_ID/purge-cdn/static/$DOMAIN/*" \
205+
--header "Authorization: Bearer $USER_OR_ACCESS_TOKEN"
206+
```
207+
208+
```sh
209+
# Storage mode: Purge all content for object storage
210+
curl --location --request PUT "https://api.app-prg1.zerops.io/api/rest/public/service-stack/$OBJECT_STORAGE_SERVICE_ID/purge-cdn/*" \
211+
--header "Authorization: Bearer $USER_OR_ACCESS_TOKEN"
212+
```
190213

191214
#### Purge Pattern Examples
192215

apps/docs/content/references/zsc.mdx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,31 @@ zsc backup-create db
8181

8282
---
8383

84+
### cdn
85+
86+
Manages CDN (Content Delivery Network) operations for your Zerops services.
87+
88+
```sh
89+
zsc cdn [command]
90+
```
91+
92+
#### Available sub-commands
93+
- `purge`: Invalidates cached content from the CDN for a specific domain. The purge command allows you to ensure that the most up-to-date content is being served to visitors after making updates to your site.
94+
95+
#### Available flags
96+
- `-h, --help`: Help for the cdn command
97+
98+
#### Examples
99+
```sh
100+
# Purge CDN cache for a specific domain
101+
zsc cdn purge example.com
102+
103+
# Purge CDN cache for a specific path on a domain
104+
zsc cdn purge example.com /images/
105+
```
106+
107+
---
108+
84109
### shared-storage
85110

86111
Manages shared storage volumes for persistent data storage.

apps/docs/static/llms-full.txt

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12522,7 +12522,22 @@ You should consider purging cached content when:
1252212522

1252312523
### Purging Cached Content
1252412524

12525-
Zerops provides a simple [API](#api-reference) to manage and purge cached content before its normal expiration. You can use wildcard patterns to target specific content sets:
12525+
Zerops provides multiple ways to manage and purge cached content before its normal expiration.
12526+
12527+
#### Using the Command Line or API
12528+
12529+
You can purge CDN cache using:
12530+
12531+
- **Command Line**: Use the [`zsc cdn purge`](/references/zsc#cdn) command available in all Zerops containers:
12532+
```sh
12533+
# Purge all content for a domain
12534+
zsc cdn purge example.com
12535+
12536+
# Purge specific path
12537+
zsc cdn purge example.com /images/
12538+
```
12539+
12540+
- **API Endpoints**: For programmatic control, use the [API endpoints](#api-reference).
1252612541

1252712542
#### Purge Pattern Examples
1252812543

@@ -45677,6 +45692,31 @@ zsc backup-create db
4567745692

4567845693
---
4567945694

45695+
### cdn
45696+
45697+
Manages CDN (Content Delivery Network) operations for your Zerops services.
45698+
45699+
```sh
45700+
zsc cdn [command]
45701+
```
45702+
45703+
#### Available sub-commands
45704+
- `purge`: Invalidates cached content from the CDN for a specific domain. The purge command allows you to ensure that the most up-to-date content is being served to visitors after making updates to your site.
45705+
45706+
#### Available flags
45707+
- `-h, --help`: Help for the cdn command
45708+
45709+
#### Examples
45710+
```sh
45711+
# Purge CDN cache for a specific domain
45712+
zsc cdn purge example.com
45713+
45714+
# Purge CDN cache for a specific path on a domain
45715+
zsc cdn purge example.com /images/
45716+
```
45717+
45718+
---
45719+
4568045720
### shared-storage
4568145721

4568245722
Manages shared storage volumes for persistent data storage.

apps/docs/static/llms-small.txt

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12247,7 +12247,22 @@ You should consider purging cached content when:
1224712247

1224812248
### Purging Cached Content
1224912249

12250-
Zerops provides a simple [API](#api-reference) to manage and purge cached content before its normal expiration. You can use wildcard patterns to target specific content sets:
12250+
Zerops provides multiple ways to manage and purge cached content before its normal expiration.
12251+
12252+
#### Using the Command Line or API
12253+
12254+
You can purge CDN cache using:
12255+
12256+
- **Command Line**: Use the [`zsc cdn purge`](/references/zsc#cdn) command available in all Zerops containers:
12257+
```sh
12258+
# Purge all content for a domain
12259+
zsc cdn purge example.com
12260+
12261+
# Purge specific path
12262+
zsc cdn purge example.com /images/
12263+
```
12264+
12265+
- **API Endpoints**: For programmatic control, use the [API endpoints](#api-reference).
1225112266

1225212267
#### Purge Pattern Examples
1225312268

0 commit comments

Comments
 (0)