[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

IMPOSSIBLE: Netscape ANIM flaw w/ Expire + GMT flaw

Posted on 1998-09-10
3
Medium Priority
?
282 Views
Last Modified: 2013-12-25
I have a banner rotation program, via a CGI-Perl script. A call is made to the ad script from my HTML webpage with the source: <img src="cgi-bin/nph-ads.cgi" width=468 height=60>

The script returns back the appropriate ad with the HTTP headers:
---
Last-Modified: Fri, 11 Sep 1998 01:54:00 GMT
Date: Fri, 11 Sep 1998 01:50:00 GMT
Expires: Fri, 11 Sep 1998 01:55:00 GMT
---
The graphic banners returned are mostly GIF anims.  
Strangely, when the GIF Anim banner has hit it's expired time (01:55), for "some reason" Netscape makes a call to the CGI script again and fetches another banner from it.  However, a non-animating banner doesn't do such a thing.

Sure the banner has expired and so doesn't exist in the cache anymore but I don't understand why Netscape makes that  automatic call to the cgi script; I didn't do anything but sit there and watch the GIF anim?  Is this a bug with Netscape and does this occur in IE?

One other question. The HTTP Header, Expires, which I send back is of course in GMT;  GMT is only good for establishing a universal "hour" between server and client.  The minutes, on the other hand, is established by using the client's minutes of the hour.  So if the client's time is: 04:30am, then the GMT time could be 00:30, where the 30 was established by the client's minutes.

Now as you can see from my output HTTP headers, my banners expire in 5 minutes from the time it was dished out to the client. So if the server time was 04:26 am then the Expires header will be set to expire at 04:31am.  

Now Netscape will "expire" the item once it has matched or exceeded the established Expires time from the server. Netscape's expire system appears to be based on the client's present time.  So if the client's time were 04:30am then the item will expire in 1 minute rather than the "full" 5 minutes.

Is there ANYWAY to be assured that the banner won't expire until the established time?

Thanks for help you can provide!
0
Comment
Question by:aniston
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
mouatts earned 400 total points
ID: 1828613
The call to the CGI is made because when an animated gif starts its cycle Netscape simply re-reads the image. In doing so it refers to the cached entry in the way it would do normally. As in you case it finds that the image has expired it it calls the CGI again to get a fresh image.

This isn't really a bug within Netscape it is meant to operate in this way generally.

Possible one could argue that it shouldn't make the reference to the cache (in these circumstance) but as it does it means that we have a choice of refreshing them as you system does or maintaining as wholly static (ie using a long expiry date) or always pulling from the server (by using the no-cache header).

The answer to your second question is no. The only way this could be achieved is if the HTTP header contained a relative time (eg expire in minutes time). Then the browser could calculate the actual time (in respect of its clock) the the expiry occurs. Unfortunatly the HTTP standard specifies that the date within the header MUST be absolute. Bear in mind that the browser only has access to the local clock and not the servers.

Having said that it is possible to synchronise a client clock to a servers clock. To do this you need a program that can access the servers TIME service and then set the time on the client based on the returned value. I suspect that for what you are doing this would not be appropriate.

Steve

0
 

Author Comment

by:aniston
ID: 1828614
Just out of curiosity how would I go about in setting the client's minutes with the server's minutes?  Can Javascript maybe check the expire date or something and just use its SETMINUTES command?

Thanks for a great answer
0
 
LVL 11

Expert Comment

by:mouatts
ID: 1828615
Unfortunatly you don't have access to the expire time from Javascript and if you did I think you would find that it would be read only in the same way as the last modified date (which you can access).

To change the clients minutes as I mentioned previously requires a program that is initiated by the client. Typically some internet suites such as Turnpike include such a feature that allows clocks to synchronize but importantly it is the client that starts things off. (I was using such a beast at one time until the clock on my ISP went haywire and set my PC clock forward several days).

However if you are using Javasscript you can rotate you advert using this. To do this you execute some javascript using the onLoad event. This code should load your additional images in and then use Window.setTimeout to setup a call to another function with your five minute timeout. When this second function is called  it should swap the image (and href if click thrus are in use) to the a previsouly loaded image and then call setTimeout again for the next rotation.

Steve
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question