Custom Platform Specific Caching

23 views
Skip to first unread message

Elvis

unread,
Aug 28, 2017, 9:18:23 AM8/28/17
to Joomla! General Development
Hi!

I know Joomla has Platform Specific Caching one can set in Global Configuration, but it doesn't separate mobile and tablet devices and I need to do that.
Currently I'm using User Agent Detector plugin from Rene Kreijveld, which uses excellent Mobile_Detect library: https://github.com/serbanghita/Mobile-Detect and which sets a session variable accordingly.

Would it be technically possible to write a caching plugin, which could extend Joomla's caching mechanism to detect devices based on Mobile_Detect library and write separate cached files according to the visitor's device?

Regards

Johan Janssens

unread,
Aug 28, 2017, 7:43:42 PM8/28/17
to Joomla! General Development
Hello Elvis,

That's pretty easy to do, you could for example switch the cache folder using a plugin based on the environment. Another option could be to change the cache key that the caching library uses. That would be a little bit harder but also doable.

Hope that helps,

Johan
Reply all
Reply to author
Forward
0 new messages