|IFrame Cache Issue,|
I have a small ad network. Its invocation codes are iframe.
The issue is that, if the publisher pastes the ad code more than one place in the same page, then there is issue with opera.
Opera loads the first iframe from the server, then loads others from cache, So all ad boxes shows the same ads.
However other browser are fine.
In Chrome, IE and FireFox, there is no problem. They show different ads in each box.
Please open this page with opera and other browsers to see the difference.
How can i prevent this opera iframe caching ?
Welcome to WebmasterWorld!
I suspect, though, that the page that gets loaded in the iframe should have some HTTP headers set to prevent it from being cached. For example:
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
Hope that helps.
The urls are static unfortunately.
Have you look at the adress above? The Issue is in Opera only. Other browsers are fine.
The page gets loaded is work.php, I added the code you provided to that page, but did not help. (May be i did not add it correctly)
Here is the my HTTP Header for the Pages which are loaded in IFrame.
GET [banner.****ireklam.com...] HTTP/1.1
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20100101 Firefox/12.0
Accept-Encoding: gzip, deflate
HTTP/1.0 200 OK
Date: Wed, 30 May 2012 14:27:25 GMT
Expires: Thu, 19 Nov 1981 08:52:00 GMT, Wed, 11 Jan 1984 05:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0, max-age=0, no-cache, no-store, must-revalidate
Pragma: no-cache, no-cache
X-Cache: MISS from x.vpsb6317a39.com
Via: 1.1 x.vpsb6317a39.com:80 (squid/2.7.STABLE9)
Isnt it ok ?
That looks correct to me (I see the Cache-Control and Expires headers in your response). The first thing I would suggest would be to empty Opera's cache, and then try it again. If you get the same results, then I'm sure Opera has some developer tools that allows you to view the request/responses, so I would check that to see that Opera is getting a 200/OK for each request (and is not getting a 304). I don't use Opera, so I can't offer much advice as to how to do this.
Here is the header of the Opera.
|URL = [banner.***ireklam.com...] |
DateWed, 30 May 2012 15:21:05 GMT
ExpiresThu, 19 Nov 1981 08:52:00 GMT, Wed, 11 Jan 1984 05:00:00 GMT
ExpiresWed, 11 Jan 1984 05:00:00 GMT
Cache-Controlno-store, no-cache, must-revalidate, post-check=0, pre-check=0, max-age=0, no-cache, no-store, must-revalidate
Cache-Controlmax-age=0, no-cache, no-store, must-revalidate
Well, the issue is that, i have placed the the same iframe 3 times on the same page.
So opera does not take care of expiry date.
If i reload the page, opera will reload the iframe from the server, not from the cache.
But when there is 3 same iframe in the same page, it unfortunately reload only the first one, other comes from the cache.
For a static page, you could try modifying the markup to include a unique value in the query string even though that value is not used on the server. For example:
This *should* force the browser to send separate requests for each.
Yep. You are right.
If i cant find a solution, i will do like that.
The script owner is a kind man, who already told that solution.
But i wanted to know, if we cant use any jquery or something like that, to force reload, or something like that.
Because for my users it may be difficult to make changes in the url or so on. That is the reason.
Then i will need to modify the php files for it ?