Forum Support JCE Plugins / Addons iframe Caching in Webkit browser
Message
  • A subscription is required to to post in this forum - Subscribe

iframe Caching in Webkit browser

Link to this post 02 Feb

Hello,

Is there a way to provide a dynamic ID to the iframe plugin to prevent Webkit browsers from caching it? I ask this because I am experiencing this issue on my client's website. Sometimes the src attributes value is loaded and sometimes it is not. For example, on one refresh the src attribute looks like this:

<iframe src="" width="100%" height="100%" />
, on the next refresh the src attribute looks like this:
<iframe src="http://form.jotform.com/form/20290053229" width="100%" height="100%" />
.

Any help with this issue would be greatly appreciated.

Thank you.

Mike
Joomla 1.7.3
JCE Editor 2.2.20
iframe Plugin 2.0.0
PHP 5.2.17
MySQL 5.5.9

Link to this post 03 Feb

Is there a way to provide a dynamic ID to the iframe plugin to prevent Webkit browsers from caching it?

Not without some additional front-end javascript...

I haven't come across an issue like this before. Please post a link to an example.

Link to this post 03 Feb

Hello,

Here is the link to the JomSocial bulletin with an iframe embedded in it: http://www.kiboodle.ca/threehills/dashboard/pages/viewbulletin/495-jotform?groupid=9

The caching issue occurs after you create a new bulletin or edit an existing one in a Webkit-based browser. You will need to be logged in as a registered user to create or edit a bulletin. If you view the source code after creating a new bulletin or editing an existing one, you will see there is no URL in the iframes src attribute. If you refresh the bulletin page, the iframes content will appear and will be visible in the iframes src attribute. The caching issue also occurs when adding an iframe to a group description in JomSocial.

Where can I send the registered user login details?

Thank you for your assistance.

Mike
Joomla 1.7.3
JCE Editor 2.2.20
iframe Plugin 2.0.0
PHP 5.2.17
MySQL 5.5.9

Link to this post 03 Feb

The caching issue occurs after you create a new bulletin or edit an existing one in a Webkit-based browser.

Do you get the same caching issue when you insert an iframe into a standard Joomla! article?

Link to this post 04 Feb

Hello,

Yes, I do experience the same caching issue when using iframes in Joomla articles. I created an article in the administrator side of Joomla with an iframe in the content area. I saved the article, logged into the front end of the website and tried editing the article there. The same issues occur here as they do in JomSocial. After editing and saving the article, the page reloads with no iframe rendering. If you view the source code, the iframe code is there, but it is missing the URL in the src attribute. If I refresh the page, the iframe content renders correctly in the browser window.

Thank you for your assistance.

Mike
Joomla 1.7.3
JCE Editor 2.2.20
iframe Plugin 2.0.0
PHP 5.2.17
MySQL 5.5.9

Link to this post 05 Feb

I don't think this is a browser caching issue, I've never come across a situation where an element has been altered in this way by a browser.

I think this might be caused by a plugin running in the site front-end, although I might be wrong.

Is the src attribute of the iframe removed in the source code?

Link to this post 06 Feb

Hello,

I think it is either a caching issue or a Webkit bug because the problem never appears in Firefox or IE.

I only have core plugins enabled for the Content type, JCE plus the core plugins for the Editors type and Admin Tools and JomSocial plus the core plugins for the System type.

This is how the iframe code is being displayed after saving an item:

<iframe src="" width="100%" height="100%"></iframe>

This is how the iframe code is being displayed after a browser refresh:

<iframe src="http://form.jotform.com/form/20290053229" width="100%" height="100%"></iframe>

As you can see, the src attributes value is not showing up after an item is saved, but if you refresh the browser window, the src attributes value appears. The whole iframe code block is being stored in the database correctly.

Any assistance would be greatly appreciated.

Thank you.

Mike
Joomla 1.7.3
JCE Editor 2.2.20
iframe Plugin 2.0.0
PHP 5.2.17
MySQL 5.5.9

Link to this post 07 Feb

I'm not sure what could be causing this issue except as you suggest, a Webkit bug. I have not yet come across another example of this (the link from you previous post no longer opens the article) so I cannot confirm it as a Webkit bug.

Link to this post 07 Feb

Hello,

Thank you for the reply. What code would I need to edit if I wanted to add a dynamic ID to the iframe element? I would like to try this out to see if it fixes the problem.

Thank you.

Mike
Joomla 1.7.3
JCE Editor 2.2.20
iframe Plugin 2.0.0
PHP 5.2.17
MySQL 5.5.9

Link to this post 07 Feb

What code would I need to edit if I wanted to add a dynamic ID to the iframe element?

It won't make any difference to change anything in JCE. You need to create a script that loads when the page loads to change the iframe src so that it isn't cached, perhaps something like:

(function($) {
$(document).ready(function(){
$('iframe').each(function() {
var s = this.src;
s += /\?/.test(s) ? '&' : '?';
this.src = s + new Date().getTime();
});
});
})(jQuery);

Search

Tweets




We will need to set cookies to do this - Learn More