Commit 990accc0 authored by Vladir Parrado Cruz's avatar Vladir Parrado Cruz

Updated the doc for cleaning the cache resources.

parent 737b4d6a
Pipeline #12050 passed with stage
in 1 minute
......@@ -16,7 +16,7 @@ curl \
cache/www.example.com/ \
-H 'Authorization: Token TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT' \
-H 'Content-type: application/json' \
-d '{"url_path_patterns": ["images jpg"]}'
-d '{"resource_path_list": ["/js/general.js?181122", "/images/logo.png"]}'
```
#### Fields to replace
......@@ -26,25 +26,8 @@ curl \
account.
- `TTTT....` Write here you API token, which you should have
received when subscribing to our service or via support channels.
- `"images jpg"` Write here a selector for the cache entries you want to
delete. More details about selectors below.
### Selector for cache entries
By selectors, we mean the expression after `“url_path_patterns”`. In the initial example we wrote `[“image jpeg”]`, and this simple string will wipe all JPEG images from the caches, so that the edges fetch fresh versions of them. By changing the string, it’s possible to target different classes of resources. There is a logic to the expressions, but it’s easier to start with some utility examples.
**Cheat sheet**
| I want to... | Selector expression |
|--|--|
|Delete a specific resource, e.g. `"/js/general.js?181122"` | Give a single string with the elements of the URL which are letters and numbers, separated by space, without any sign separators. Note that if the resource is being pulled as a file, the query string component is not indexed, so you shouldn’t use it. Works for generated assets: `["js general js 181122"]`. Works for both generated and file assets, but it won’t discriminate resource versions given via a query string: `["js general js"]` |
|Delete all images | Give a list of image mime types that you use across your site, again without punctuation marks: `["image jpeg", "image png", "image gif", ... ]` or use boolean syntax: `["image AND (jpeg OR png)"]`. If you are confident that all your image mime types contain the word `“image”`, then you can also use this: `["mime_type: image"]` |
| Delete all resources that start with a particular URL path, e.g. everything that starts with `"/js/default/"` | Use a `“^”` at the start of the expression, like this: `["^ js default"]`. It’s possible to be more specific by indicating that we are interested in matching only relative paths: `["relpath: ^ js + default"]`. |
#### What is this selector syntax?
Each ShimmerCat deployment maintains a separate full-text search index of all cached entries of each domain, using SQLite’s FT5 FTS engine. The selectors for cache entries are simply FT5 arguments to the MATCH filter keyword, over a full-text search table with two columns: relpath and mime_type . You can learn everything about this query language using the <a target="_blank" href="https://sqlite.org/fts5.html">official SQLite3 documentation</a> for it.
- `["/js/general.js?181122", "/images/logo.png"]` Write here the resources for the cache entries you want to
delete. It is a list of the resources you want to delete the cache for.
### Reporting issues
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment