Page Cache disables redirect

Discussion regarding Joomla! 3.x Performance issues.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
OriyanJ
Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Sat May 02, 2015 11:52 am

Page Cache disables redirect

Postby OriyanJ » Wed Jun 07, 2017 10:15 am

I've created a system plugin (using onBeforeRender and Mobile_Detect) to redirect mobile users to my mobile sub-domain, but it seems that when System - Page Cache is enabled, that redirect doesn't work. I believe it has something to do with the ETag.

I'm using a simple code to do that:

Code: Select all

$detect = new Mobile_Detect();
if ($detect->isMobile())
    header('Location: '.$url);


What could be the cause of this matter?

OriyanJ
Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Sat May 02, 2015 11:52 am

Re: Page Cache disables redirect

Postby OriyanJ » Mon Jun 19, 2017 7:50 am

Well, I found out what I was doing wrong. Instead of using the onBeforeRender I should have used the onAfterInitialise.


Return to “Performance - Joomla! 3.x”

Who is online

Users browsing this forum: No registered users and 5 guests