Can Posted July 21, 2014 Posted July 21, 2014 Using MarkupCache and needed to switch the page to MultiLanguage. First I thought oooh my god how can I achieve this without having code duplications within complex conditions?! But it's PW (in this case it's just PHP logic^^) but PW is great! You "only" have to set the name of the cache file dynamically based on the language. Nothing easier than that. Just replace the normal initialization of the cached section from <?php if(!$data = $cache->get("something")) { to <?php if (!$data = $cache->get("something_lang-{$user->language->name}")) { Then, assuming whe have 2 languages, default and de, it's generating one cache file called "something_lang-default" and "something_lang-de" of course you can set the name format to whatever you prefer Just wanted to share my achievement for everyone else looking for MarkupCache on a multi language site cheers Can 1
Adam Kiss Posted September 2, 2015 Posted September 2, 2015 Ryan, is there any particular reason why this module is singular? (Or better question: could it not be?) I think that blocks nested caching (which is @Hari's problem as well, I think). Thanks.
pwFoo Posted September 25, 2017 Posted September 25, 2017 Should WireCache used instead of MarkupCache? Pro / cons to use MarkupCache?
abdus Posted September 25, 2017 Posted September 25, 2017 @pwFoo MarkupCache only supports strings and uses files for storage. WireCache supports arrays (of non-objects), PageArray and strings and uses DB for storage. WireCache is the way to go. 1 1
ziu Posted January 14, 2018 Posted January 14, 2018 Hi can anyone tell me how to use markup cache with images. @Can @pwFoo Thanks regards 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now