[Q] pragma no-cache : what about the images ?

P

Paul J. Le Genial

I would like to include these meta-tags in the head of my form pages:
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
so that the content of these pages will not be stored in the browser cache.

My question is: will the images displayed in thess form pages be stored in
the browser cache or not (these images are common to all form pages but are
not showed anywhere else on the site)?

Thanks
 
P

Philip Ronan

Paul said:
I would like to include these meta-tags in the head of my form pages:
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
so that the content of these pages will not be stored in the browser cache.

My question is: will the images displayed in thess form pages be stored in
the browser cache or not (these images are common to all form pages but are
not showed anywhere else on the site)?

It won't make any difference. These meta tags only affect the HTML document
that contains them. If you like, you could configure your server to add the
equivalent HTTP headers to your images. But that would just increase the
bandwidth consumed by your website and make your pages load slower. Is that
what you want?
 
D

David Dorward

Paul said:
I would like to include these meta-tags in the head of my form pages:
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
so that the content of these pages will not be stored in the browser
cache.

Oh dear. Use real http headers. (For that matter, the Expires header takes a
date - and "-1" doesn't qualify.)

http://www.mnot.net/cache_docs/
My question is: will the images displayed in thess form pages

HTTP headers apply to the resource they are delivered with. If you want to
send cache information for an image, it has to come with the image, not an
HTML document that references it.
 
N

n|ck

David said:
Oh dear. Use real http headers. (For that matter, the Expires header takes a
date - and "-1" doesn't qualify.)

On a related note, would it be just as effective if you were to use <?php
header("Cache-Control: no-store"); ?> at the start of the file that you wanted
to keep fresh? Instead of using an .htaccess file, that is. I'm curious about
using something like that on my site (news area).

Nick.
 
P

Philip Ronan

n|ck said:
On a related note, would it be just as effective if you were to use <?php
header("Cache-Control: no-store"); ?> at the start of the file that you wanted
to keep fresh? Instead of using an .htaccess file, that is. I'm curious about
using something like that on my site (news area).

Nick.

Sure you could.

But why not do things a bit more intelligently?

Download a copy of RFC 2616 and read up on conditional requests,
Last-Modified headers etc.

Your pages will load faster, and your site's bandwidth will be lower. Isn't
that what you want?
 
N

n|ck

Philip said:
Sure you could.

But why not do things a bit more intelligently?

Download a copy of RFC 2616 and read up on conditional requests,
Last-Modified headers etc.

Your pages will load faster, and your site's bandwidth will be lower. Isn't
that what you want?

Actually, in this particular situation (I'm not the OP, btw), it wouldn't really
matter. Adding a line of PHP won't make that much of a difference. But, thanks
anyway.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top