Re: Random Image and Cache problem

2007-09-03 Thread Dr.Ruud
Carl Miller schreef:

> The other website would call the perl script in an  tag, like so:
>
> http://www.my_site.com/cgi-bin/random_banner.cgi";
> width="468" height="60">
>
> I've tried several perl scripts that basically work, but the problem
> is always the same with all of them: the browser always caches
> 'random_banner.cgi' causing the same banner to be displayed on every
> subsequent page.

Also try a src-value ending in a "?".

  http://www.my_site.com/cgi-bin/random_banner.cgi?";
  width="468" height="60">

and if you generate the HTML each time, you can even put a time() value
after it:

  http://www.my_site.com/cgi-bin/random_banner.cgi?t=14325";
  width="468" height="60">

-- 
Affijn, Ruud

"Gewoon is een tijger."


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Random Image and Cache problem

2007-09-03 Thread Mumia W.

On 09/03/2007 10:06 AM, Carl Miller wrote:

Thanks Gunnar and Mumia.

I figured out that the problem is unique to Internet Explorer. The three 
other browsers I tried don't have this problem. But I can't get IE to not 
cache. I've tried these:


print "Cache-Control: no-cache\n";
print "Pragma: no-cache\n";  # for HTTP/1.0
print "Expires: Fri, 26 Mar 2004 01:40:42 GMT\n";
print "Cache-Control: must-revalidate, max-age=1\n";

IE still caches. 


Can anyone give some insight into where the problem might be?

Thanks.



I wish I could help you. I once had a problem with IE caching too much 
data, and that problem caused me to look bad on my job. I didn't 
appreciate it very much.


We have to live in an IE environment whether we like it or not. I hope 
you figure out how to get IE behaving properly; I never really did. By 
the time I figured out that something was really wrong with my pages, 
and it related to how IE was caching them on my boss' computer, the 
damage to my image had been done.




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Random Image and Cache problem

2007-09-03 Thread Tom Phoenix
On 9/3/07, Carl Miller <[EMAIL PROTECTED]> wrote:

> I figured out that the problem is unique to Internet Explorer. The three
> other browsers I tried don't have this problem. But I can't get IE to not
> cache.

> Can anyone give some insight into where the problem might be?

It's in Internet Explorer, not in Perl. Try asking in a forum
dedicated to Internet Explorer, instead of one about Perl. Good luck
with it!

--Tom Phoenix
Stonehenge Perl Training

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Random Image and Cache problem

2007-09-03 Thread Carl Miller
Thanks Gunnar and Mumia.

I figured out that the problem is unique to Internet Explorer. The three
other browsers I tried don't have this problem. But I can't get IE to not
cache. I've tried these:

print "Cache-Control: no-cache\n";
print "Pragma: no-cache\n";  # for HTTP/1.0
print "Expires: Fri, 26 Mar 2004 01:40:42 GMT\n";
print "Cache-Control: must-revalidate, max-age=1\n";

IE still caches. 

Can anyone give some insight into where the problem might be?

Thanks.




On 9/2/07 3:34 PM, "Mumia W." <[EMAIL PROTECTED]> wrote:

> On 09/02/2007 01:16 PM, Carl Miller wrote:
>> I'm trying to setup a simple random image script to allow other websites to
>> display random banner ads located on my server.
>> 
>> The other website would call the perl script in an  tag, like so:
>> 
>> http://www.my_site.com/cgi-bin/random_banner.cgi"; width="468"
>> height="60">
>> 
>> I've tried several perl scripts that basically work, but the problem is
>> always the same with all of them: the browser always caches
>> 'random_banner.cgi' causing the same banner to be displayed on every
>> subsequent page. The only way to see a different banner is to hit
>> Reload/Refresh.
>> 
>> Is there a script out there that avoids the cache problem in displaying
>> random banners via an  tag?
>> 
>> Thanks!
>> 
>> 
>> 
> 
> Use a "Cache-control" header that specifies "no-cache" and use an
> Expires header that uses a date in the past.
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Random Image and Cache problem

2007-09-02 Thread Mumia W.

On 09/02/2007 01:16 PM, Carl Miller wrote:
I'm trying to setup a simple random image script to allow other websites to 
display random banner ads located on my server.


The other website would call the perl script in an  tag, like so:

http://www.my_site.com/cgi-bin/random_banner.cgi"; width="468" 
height="60">


I've tried several perl scripts that basically work, but the problem is 
always the same with all of them: the browser always caches 
'random_banner.cgi' causing the same banner to be displayed on every 
subsequent page. The only way to see a different banner is to hit 
Reload/Refresh.


Is there a script out there that avoids the cache problem in displaying 
random banners via an  tag?


Thanks!





Use a "Cache-control" header that specifies "no-cache" and use an 
Expires header that uses a date in the past.




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Random Image and Cache problem

2007-09-02 Thread Gunnar Hjalmarsson

Carl Miller wrote:

I'm trying to setup a simple random image script to allow other websites to
display random banner ads located on my server.

The other website would call the perl script in an  tag, like so:

http://www.my_site.com/cgi-bin/random_banner.cgi"; width="468"
height="60">

I've tried several perl scripts that basically work, but the problem is
always the same with all of them: the browser always caches
'random_banner.cgi' causing the same banner to be displayed on every
subsequent page. The only way to see a different banner is to hit
Reload/Refresh.

Is there a script out there that avoids the cache problem in displaying
random banners via an  tag?


Let the script print a couple of no-cache CGI headers:

print "Cache-Control: no-cache\n";
print "Pragma: no-cache\n";  # for HTTP/1.0

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Random Image and Cache problem

2007-09-02 Thread Carl Miller
I'm trying to setup a simple random image script to allow other websites to
display random banner ads located on my server.

The other website would call the perl script in an  tag, like so:

http://www.my_site.com/cgi-bin/random_banner.cgi"; width="468"
height="60">

I've tried several perl scripts that basically work, but the problem is
always the same with all of them: the browser always caches
'random_banner.cgi' causing the same banner to be displayed on every
subsequent page. The only way to see a different banner is to hit
Reload/Refresh.

Is there a script out there that avoids the cache problem in displaying
random banners via an  tag?

Thanks!



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/