Browser Cache Rule
This setting is available in small, large and dynamic(aksela) resource types.
Parameters | Description | Type | Required |
---|---|---|---|
organization_uuid | The created organization in Medianova Cloud Panel unit ID value. Path parameter. | String | Yes |
resource_uuid | The created resource in Medianova Cloud Panel unit ID value. Path parameter. | String | Yes |
browser_cache_rules | A maximum of 15 rules can be defined. | Array | Yes |
browser_cache_rules.type | This parameter takes one of the values “all_files”, “full_path”, “directory”, “file_extension”. | String | Yes |
browser_cache_rules.content | If browser_cache_rules.type is “full_path” or “directory” or “file_extension”, browser_cache_rules.content is required. If If browser_cache_rules.type is all_files, browser_cache_rules.content must be empty.
| Array | Yes |
browser_cache_rules.priority | You can enter between 1-100. The priority order is from most to least. The browser_cache_rules.0.priority field is required unless browser_cache_rules.0.is_delete is in true. | Integer | Yes |
browser_cache_rules.cache_mode | This parameter takes one of the values “origin”, “cache”, “no_cache”.
| String | Yes |
browser_cache_rules.cache_time | Specifies the cache duration for requests made by the browser. In this way, when the time expires, the user requests the content again from the CDN. Entry is made in seconds. | Integer | No |
browser_cache_rules.directive | Specifies Cache-Control header directives. This parameter takes the values “must-revalidate”, “no-cache”, “no-store”, “no-transform”, “public”, “private”, “proxy-revalidate” | Array | No |
browser_cache_rules.exact_match | If the entry type is Directory and a single directory information entry is provided, an exact match can be used. If browser_cache_rules.type is directory, browser_cache_rules.exact_match is required. | Boolean | No |
browser_cache_with_html | This parameter controls whether the browser caches HTML content. A value of 'true' enables caching, while 'false' disables it. This can impact the performance of web applications. | Boolean | No |
browser_cache_rules.is_delete | True is sent to delete a specific rule. There is an example in the second payload. | Boolean | No |
Notes
Full Path:
Directory:
File Extension:
|
Payload
{
"resource_uuid": "****-****-****-***",
"browser_cache_rules": [
{
"type": "all_files",
"content": [],
"priority": 50,
"cache_mode": "origin",
"cache_time": 0,
"directive": [],
"exact_match": false
},
{
"type": "full_path",
"content": [
"/example/images.jpg"
],
"priority": 40,
"cache_mode": "cache",
"cache_time": 60,
"directive": [
"must-revalidate",
"public",
"private"
],
"exact_match": false
},
{
"type": "directory",
"content": [
"/test",
"/test1/"
],
"priority": 100,
"cache_mode": "no_cache",
"cache_time": 0,
"directive": [],
"exact_match": false
},
{
"type": "file_extension",
"content": [
".png",
".jpg"
],
"priority": 30,
"cache_mode": "cache",
"cache_time": 30,
"directive": [
"must-revalidate",
"no-cache",
"no-store",
"no-transform",
"public",
"private",
"proxy-revalidate"
],
"exact_match": false
},
{
"type": "directory",
"content": [
"/sinem/"
],
"priority": 30,
"cache_mode": "cache",
"cache_time": 30,
"directive": [
"must-revalidate",
"no-cache",
"no-store",
"no-transform",
"public",
"private",
"proxy-revalidate"
],
"exact_match": true
}
],
"browser_cache_with_html": false
}
Payload - Delete Rule
{
"resource_uuid": "****-*****-****-****",
"browser_cache_rules": [
{
"id": 1,
"type": "all_files",
"content": [],
"priority": 50,
"cache_mode": "origin",
"cache_time": 0,
"directive": [],
"exact_match": false,
"is_delete": true
},
{
"id": 2,
"type": "full_path",
"content": [
"/example/images.jpg"
],
"priority": 40,
"cache_mode": "cache",
"cache_time": 60,
"directive": [
"must-revalidate",
"public",
"private"
],
"exact_match": false,
"is_delete": false
},
{
"id": 3,
"type": "directory",
"content": [
"/test",
"/test1/"
],
"priority": 100,
"cache_mode": "no_cache",
"cache_time": 0,
"directive": [],
"exact_match": false,
"is_delete": false
},
{
"id": 4,
"type": "file_extension",
"content": [
".png",
".jpg"
],
"priority": 30,
"cache_mode": "cache",
"cache_time": 30,
"directive": [
"must-revalidate",
"no-cache",
"no-store",
"no-transform",
"public",
"private",
"proxy-revalidate"
],
"exact_match": false,
"is_delete": false
},
{
"id": 5,
"type": "directory",
"content": [
"/sinem/"
],
"priority": 30,
"cache_mode": "cache",
"cache_time": 30,
"directive": [
"must-revalidate",
"no-cache",
"no-store",
"no-transform",
"public",
"private",
"proxy-revalidate"
],
"exact_match": true,
"is_delete": false
}
],
"browser_cache_with_html": 0
}