[DOCU-2664] DOC: Cache invalidation can be triggered via external REST endpoints Created: 28/Feb/23  Updated: 01/Mar/23  Resolved: 01/Mar/23

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Jan Schulte Assignee: Martin Drápela
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Documentation page URL: https://docs.magnolia-cms.com/product-docs/6.2/Features/Cache.html

 Description   

A client asked for custom cache invalidation. Seems like we support that with our cache commands: https://demo.magnolia-cms.com/.magnolia/admincentral#app:configuration:browser;/modules/cache/commands/cache/flushAll:treeview

 

Can we please document this option? 

Would be also helpful to mention that those commands can be triggered via external rest endpoints

https://docs.magnolia-cms.com/product-docs/6.2/Developing/API/Commands-API.html



 Comments   
Comment by Roman Kovařík [ 28/Feb/23 ]

For the record, I've found a mention on https://docs.magnolia-cms.com/product-docs/6.2/Modules/List-of-modules/Cache-modules/Cache-core.html#_commands

Comment by Jan Schulte [ 28/Feb/23 ]

Oh cool! I clearly missed this one. Anyhow can we add a explanation/ example that cache access/validation would be possible via Rest(Rest commands ) as the use case becomes more relevant by prospects coming with a SAAS mindset?

 

Comment by Roman Kovařík [ 28/Feb/23 ]

Sounds good

Comment by Martin Drápela [ 01/Mar/23 ]

For the REST way, reusing the info from HELPDESK-1517:

 

 

 
 

Yes you need to flush your cache so that content could be updated. This is how cache works and we support customers in that we automatically flush the cache (or site's cache) once new content being published. This way help display the published content correctly after publishing.

You can also deliver a rest command to flush your cache follow our Commands endpoint API and you need to configure your REST security to support that command.

An example of flush cache command:
[^config.modules.rest-services.rest-endpoints.commands.enabledCommands.flushAll.yaml]

Command to flushAll cache - note that we need a post for command API working:

curl 'https://demopublic.magnolia-cms.com/.rest/commands/v2/cache/flushAll' -H "Content-Type: application/json" -X POST

Hope this helps and have a good day!

Comment by Martin Drápela [ 01/Mar/23 ]

https://docs.magnolia-cms.com/product-docs/6.2/Developing/API/Commands-API.html#_call_the_flushcachescommand_command

Generated at Mon Feb 12 01:29:09 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.