?
Solved

HTML page/CGI script loading EVERTIME: No CACHE!

Posted on 1997-11-01
7
Medium Priority
?
240 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
WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

 

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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

765 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