# Invalidate release-mode static caches with TOUCH

> Serve and modify a temporary static file, clear its cached representation and remove cached 404 entries.

Framework: total5
Product: Total.js 5 (total5@0.0.19)
Language: en
Content-SHA256: 74d53a2b7d1a609a9c88ee5f5d38268ea8eb33b899b80fd78848ba95b5ae4e8c
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: total5-installed@total5@0.0.19
Review: not-recorded

`TOUCH(url)` clears three cache entries for that URL: `F.temporary.minified`, `tmp` and `notfound`. `TOUCH()` clears those maps. It does not clear `CACHE`, NoSQL documents or every view/configuration cache. Call it after changing a generated asset in release mode. Keep this operation in trusted server code; the write endpoint below is only a local fixture.

Cache invalidation applies to the running process. When an application runs in several processes, coordinate invalidation across those processes.

```text public/generated.txt
before
```

```js controllers/assets.js
exports.install = function() {
	ROUTE('POST /regenerate/', function($) {
		F.Fs.writeFileSync(PATH.public('generated.txt'), 'after');
		F.Fs.writeFileSync(PATH.public('appeared.txt'), 'created');
		TOUCH('/generated.txt');
		TOUCH('/appeared.txt');
		$.success();
	});
};
```
