Invalidate release-mode static caches with TOUCH
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.
beforeexports.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();
});
};