Clear cache command

How to use the clear cache command

  • 6 LTS
  • 7 LTS
  • 8 LTS
  • 9 LTS
  • 10-dev

Problem

If you want to clear the cache of another page or folder after editing a page or folder, you usually have to do this manually. This is bad if plugins on another page changing contents of records, and the cached frontend doesn´t refresh that content.

Example

The folder with id 1 got edited. Page 42 contains a frontend plugin which uses records of folder 1.

After editing something of folder 1, the cache of page 42 should be cleared automatically.

The solution

Open the page settings of your page/folder (folder 1 in our example) and add the following code into the Page TSconfig (Page > Edit > Resources).

 

# Clear cache of page 42 after any changes on this page/folder.
TCEMAIN.clearCacheCmd = 42