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.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
OriyanJ
Joomla! Apprentice
Joomla! Apprentice
Posts: 47
Joined: Sat May 02, 2015 11:52 am

Page Cache disables redirect

Post by 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: 47
Joined: Sat May 02, 2015 11:52 am

Re: Page Cache disables redirect

Post by 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.


Locked

Return to “Performance - Joomla! 3.x”