Fluent and Partial Caching

Fluent is a great SilverStripe module for translating sites, that need the same tree for all locales. Unfortunately there are some pitfalls with partial caching.

Fluent docs say, you have to add the cache key $CurrentLocale to each <% cached ... %> tag in your templates. That sounds like work, doesn't it?

But you're lucky. You can add some keys globally by using SSViewer.global_key config:

  global_key: '$CurrentReadingMode, $CurrentUser.ID, $CurrentLocale'

does the trick globally after a flush which recompiles the templates.

Rate this post

Post your comment


No one has commented on this page yet.

RSS feed for comments on this page | RSS feed for all comments