---
title: "set cache control · RUAL Documentation"
description: "Changes how a PUBLISHED public-media file may be cached, on object storage and at the edge, without re-uploading it. Give no-store for media that must n…"
canonical: https://docs.rual.nl/block-types/files/file_cache_control
language: en
---

[Cluster](https://docs.rual.nl/cluster)

[Blocks](https://docs.rual.nl/block-types)

[Interfaces](https://docs.rual.nl/interfaces)

[Blueprints](https://docs.rual.nl/blueprints)

[Blueprint Language](https://docs.rual.nl/engine)

[Tutorials](https://docs.rual.nl/tutorials)

[Home automation](https://docs.rual.nl/home-automation)

[Examples](https://docs.rual.nl/examples)

[Reference](https://docs.rual.nl/reference)

[Architecture](https://docs.rual.nl/architecture)

[Troubleshooting](https://docs.rual.nl/troubleshooting)

Other

# set cache control

This block is part of the [`files`](https://docs.rual.nl/block-types/files) group and was last modified in core [`v10.4.28`](https://docs.rual.nl/core-versions/100428).

Changes how a PUBLISHED public-media file may be cached, on object storage and at the edge, without re-uploading it. Give `no-store` for media that must never be kept anywhere but its origin : a one-time photo the moment its message becomes one-time : or `public, max-age=31536000, immutable` to make it cacheable again. The resized variants of the file (`{name}_{w}x{h}.{ext}`, as resize image writes them, named after the file's `filename` as well as its path) are re-tagged with it. Only files in the trees the media mirror serves; a file outside them answers `NOT_MIRRORED`, a file that never reached the store `OBJECT_MISSING`.

- flow `flow`

- files required `file`

- cache control required `value` The Cache-Control the object should carry from now on, e.g. `no-store`.

- flow `flow`

- success `condition`

- error `value`

- files `file`

Re-tags an already published public-media file's Cache-Control on object storage (copy onto itself with replaced metadata) and purges the edge caches. Use `no-store` when a message is made one-time/ghost so its photo is never cached at the edge or in a browser; the file's resized variants ({name}_{w}x{h}.{ext}, found by the file's `filename` as well as its path basename) are re-tagged along with it; a variant missing on the store is skipped. Requires the media mirror (cluster setting media_object_storage_provider); files outside the mirrored trees answer NOT_MIRRORED on `error` with `success` false; a named file that is not on the store answers OBJECT_MISSING.

| `no-store` |
| --- |
| `one-time` |
| `ephemeral` |
| `cache` |
| `uncache` |
| `immutable` |

A typical wiring for [set cache control](https://docs.rual.nl/block-types/files/file_cache_control): a [function trigger](https://docs.rual.nl/block-types/globals/trigger_custom_function) starts the flow; [get file from assets](https://docs.rual.nl/block-types/files/file_from_assets) feeds the `file` pin; [value](https://docs.rual.nl/block-types/value/value_default) feeds the `value` pin; the `flow` out pin feeds [debug](https://docs.rual.nl/block-types/state%2520ui/state_debug).

[![Studio canvas example for the set cache control block: typical wiring for set cache control.](https://docs.rual.nl/canvas-examples/file_cache_control.png)](https://docs.rual.nl/canvas-examples/file_cache_control.png?v=3)

## Version history

Introduced in [`v10.4.28`](https://docs.rual.nl/core-versions/100428).

- [Back to `files`](https://docs.rual.nl/block-types/files): Return to the main group to view all sub-groups

- [Back to `file modification`](https://docs.rual.nl/block-types/files?group=file%20modification): Return to the group to view all blocks within this group

Was this page helpful? [Tell us what to improve](https://docs.rual.nl/support) · RUAL Docs is an integral component of the [RUAL ecosystem](https://rual.nl)
