Topic-icon Cache Buster / Redirect Problem with Facebook Tab & Live Site

Active Subscriptions:

None
Hey Alex,

I'm seeing an issue with JFBC occasionally redirecting pages on my live site to either the Fan Gate or the Reveal page. This is happening after a user views the facebook tab.

I remember we had an issue with this in the past, not sure why it cropped up again. I don't *think* it has anything to do with the redirect code I added to the canvas.php file, because I've seen the live site redirect to both the reveal page and the tab page. And I think the redirect change I made should only affect the tab page.

It seems to happen consistently if I view the tab on facebook and I'm logged out of facebook, and then I navigate to the live site. On the live site, this redirect happens whether I am logged in or out of Joomla.

Any thoughts on how to troubleshoot this?
The topic has been locked.
Active Subscriptions:

None
Friendly bump for help.
The topic has been locked.
Support Specialist
Ryan,
Sorry for the delay. Meant to look into this more. Your bump was well done and received :)

That shouldn't have anything to do with the canvas.php code you change (always possible, but doubtful). Definitely sounds like a caching problem. It's likely that the browser has cached the original (non Reveal Page URL), but since we're doing a redirect behind the scenes, it's thinking that the normal page is actually the reveal page. Confusing, but a few options to try and fix. Since it seems very reproducible, that's a good thing for fixing quickly.

The easiest thing to try is in the canvas.php file, look for the reveal page redirect. It looks like this line (yours may be different with mods):
$app->redirect('index.php?option=com_content&view=article&tmpl=component&id=' . $revealPage);
Change that to:
$app->redirect('index.php?option=com_content&view=article&tmpl=component&id=' . $revealPage.'&cb='.time());
That last part (&cb='.time()) will make the URL unique each time which may help prevent caching. I don't think that will fix it, but it's the quickest thing now.

If it doesn't work, can you tell me if you have the System - Cache plugin enabled (I think you do) and most importantly if it is enabled, is the "Enable Browser Caching" parameter in there set as well? If so, try disabling just the browser caching setting, kill your browser cache, and see if you can recreate it. That will really help narrow down the cause.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
Thanks Alex! I've been doing some troubleshooting this morning. I set canvas.php back to stock and the redirect problem was still occurring, so it definitely wasn't triggering the issue.

All caching is turned off, except in the .htaccess file, I am leveraging some browser caching (Expires) for everything except Javascript.

This morning, I did exclude one of your javascript files from being combined by Admin Tools, and since doing that, I haven't seen the redirect problem occur again (I have not exhaustively tested this yet): /components/com_jfbconnect/includes/jfbconnect.js

I didn't see anything in that file which looked like a cache buster or facebook app checker, but you would know the code better than me.

One other note: I'm seeing your jfbconnect.js file load twice in the source code of all pages. Should it be doing that?
The topic has been locked.
Active Subscriptions:

None
Scratch the note about your JS file appearing twice, looks like Admin Tools was at fault. I just upgraded to the latest version and this was in the release notes... :)

# Skipping CSS and JS from being combined didn't work when using a browser on Windows to set up the skips
# The skipped CSS and JS files would appear twice on the page
The topic has been locked.
Support Specialist
Ryan,
Glad that dual JS thing wasn't us. Would have thrown me for a loop on that one :)

I honestly can't imagine how excluding our JS file would prevent the redirections. If you can disable browser caching for specific pages, I'd recommend doing that for the main Page Tab landing page (what you have configured in your Facebook Application) and the possible Reveal Pages that can be shown. That should fix it. We're also looking at other alternatives (including the code mentioned above), but please let us know how any of these suggestions go.

Thanks,
Alex
The topic has been locked.