Solved

HTML page/CGI script loading EVERTIME: No CACHE!

Posted on 1997-11-01
7
239 Views
Last Modified: 2013-11-18
Are there any HTML or Javascript commands which will allow
me to call HTML pages or CGI scripts anywhere in my HTML/
JAVASCRIPT code?

I am presently using the <IMG> tag to load my CGI script which checks the clock on the server and sends back the binary code of a .GIF file representing the graphical time. The problem with it comes when the screen is resized or a user leaves and later comes back.  The browser caches everything and so my <IMG> tag with the CGI call is never called again only showing a "static" incorrect time.

Once again, are there any HTML or Javascript commands which will allow me to call HTML pages or CGI scripts anywhere in my HTML/JAVASCRIPT code and won't be cached so that the load will always be a genuine load?
0
Comment
Question by:ljaques
[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
  • 2
  • 2
  • +1
7 Comments
 
LVL 6

Accepted Solution

by:
Holger101497 earned 20 total points
ID: 1272184
If you include this line in the <HEAD> section of your document, the browser should not create a cache-file for your page:
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
As you said: NO CACHE *g* ;-)

Let me know if that solved your problem.

P.S.: Alternatively, you could include
<META HTTP-EQUIV="Expires" CONTENT="Sat, 01 Nov 1997 16:00:00 GMT">

Good luck!
0
 
LVL 6

Expert Comment

by:alamo
ID: 1272185
Sorry Holger, right idea but I don't think that will solve his problem - hope I am reading this one correctly  :-)

It's not his main page that has a problem being cached, it's the IMG sent by his CGI script. So no-cacheing the main page will cause the page to be reloaded even though it hasn't changed, yet the image showing the time will itself still be cached.

Add the headers to the output of the cgi script:

Expires: Sat, 01 Nov 1997 16:00:00 GMT
Pragma: no-cache

0
 

Expert Comment

by:jujoo
ID: 1272186
Alamo, in the CGI script don't you output the:
         Content-type: text/html\n\n
header first?  Does he have to place:
  Expires: Sat, 01 Nov 1997 16:00:00 GMT
  Pragma: no-cache
before or after it...
0
Independent Software Vendors: 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!

 

Expert Comment

by:jujoo
ID: 1272187
Alamo, in the CGI script don't you output the:
         Content-type: text/html\n\n
header first?  Does he have to place:
  Expires: Sat, 01 Nov 1997 16:00:00 GMT
  Pragma: no-cache
before or after it...
0
 
LVL 6

Expert Comment

by:alamo
ID: 1272188
jujoo, I don't think the order of headers is that important, though I can't say I am certain since I always by convention put the Content-type: text/html header first. I'll have to look into this.

One thing though - the \n\n at the end of the Content-type: text/html header in your example causes a blank line, and THAT will end the headers and prevent the others from working. The extra \n always has to be on your final header.
0
 
LVL 6

Expert Comment

by:Holger101497
ID: 1272189
hmm... did my answer solve your problem or not?
If it didn't, you should reject it instead of giving a D
If it did, I don't see why I would get a D!!
I'd actually rather pass on the 22 points than get a D in my profile...(the only other grade lower than B was an "accident" and not intended...)
0
 

Author Comment

by:ljaques
ID: 1272190
Holger, I really apologize for that.  It was actually an accident.  It was supposed to be a B but it was sent off (and stranbgely enough the CGI reacted quickly for once).  Whjat can I do to correct the mistake to my real value of B?

I'd appreciate your help.  You are a very brainy guy Holger and have helped me before and I'd hate for you to avoid because of this accidental mistake.

BTW: Anyone know what to get caching to work for MS Explorer 3.0 and Netscape 2.0 and down?  These browsers seem to insist on having cache remain on (I can't turn them off via HTML).


0

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn how to dynamically set the form action using jQuery.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

726 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