[MGNLCACHE-169] Question: Is there a way to flush cache based on Language? Created: 14/Mar/17  Updated: 10/May/17  Resolved: 10/May/17

Status: Closed
Project: Cache Modules
Component/s: None
Affects Version/s: 5.4
Fix Version/s: None

Type: Task Priority: Neutral
Reporter: William Paoli Assignee: Unassigned
Resolution: Not an issue Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Date of First Response:

 Description   

Is there a way to clear caches per locale/language.

For example, if we wanted to clear the cache only for /es/ and not /de/, and not (/ or /en), is that possible somehow?

Our use case is related to how we want to do translations from english to other languages.

Example:

  1. Homepage gets created in english and is live at 'domain.com/'
  2. Page gets translated to Spanish and is live at 'domain.com/es/'
  3. Homepage gets edited or modified with more English content
  4. We flush cache only for English and not on Spanish
  5. After Spanish is translated the cache is individually cleared on 'domain.com/es/' (via REST API or through the UI)

Been looking through these docs:
https://documentation.magnolia-cms.com/display/DOCS/Cache+core

Looking at Flush Policy and also looking here:
https://documentation.magnolia-cms.com/display/DOCS/Advanced+Cache+App+module



 Comments   
Comment by Roman Kovařík [ 15/Mar/17 ]

Hello wpaoli,

the multisite configuration for older Magnolia versions (Magnolia < 5.4) should do the trick https://documentation.magnolia-cms.com/display/DOCS53/Advanced+Cache+module#AdvancedCachemodule-Multisitecacheconfiguration. (only the first paragraph)
You just don't have different sites but different language subtrees.
Be aware that cacheConfigurationName should be now (Magnolia > 5.4) named defaultContentCachingConfigurationName.

Hope that helps
Roman

Comment by William Paoli [ 15/Mar/17 ]

Roman, thank you for your reply I think we may have a few more questions about language sub-trees, but for now this is a great confirmation that 'yes you are on the right track'. Thanks!!

Comment by Nick Dupuy [ 15/Mar/17 ]

Thanks Roman, does this approach mean we would need to create site definitions for each language, e.g. site1-en, site1-de, etc.., and does that mean we would need to duplicate the pages in site1 for each language?

Comment by Roman Kovařík [ 17/Mar/17 ]

Hi ndupuy@atlassian.com
it'd be probably the easies solution. site-de would just extends site-en (only the configured domain would be different). The tree would be the same for all.

Regards
Roman

Comment by Nick Dupuy [ 17/Mar/17 ]

Ah thanks Roman - that makes sense, we'll try that out.

Generated at Sun Feb 11 23:52:52 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.