Site Reference Forums

You are not logged in.

#1 2007-12-19 16:36:50

Seven
Member
From: Tattooine
Registered: 2007-10-05
Posts: 59
I've been thanked 2 times.

Thank me Website
Buy me a beer

No Store - No Cache - Big Problem

IE and Firefox seem to just ignore my my meta No Cache - No Store code.

Code: html

<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 
<META HTTP-EQUIV="Pragma" CONTENT="no-store">
<META HTTP-EQUIV="Expires" CONTENT="-1">


We have a program that pulls a new copy of the very latest college class schedules from the mainframe and spits out a .PDF file everyday nice and fresh on our web server.  That way students have the latest and greatest documentation.

Unfortunately the .PDF caches in both IE and Firefox displaying an out of date PDF file.  In order for the little program to work that the programmer created, the file name of the PDF must remain the same.

The programmer gets calls from the higher ups who tell him, "your program isn't working!!"  So he then calls me, "what is wrong with the web server!"  Then I tell everyone -- hit F5 (refresh) -- they do and go, "oh - guess it is working"  -- then they demand I make sure it never caches because who is going to tell the students F5? Well I don't know - that's why I'm assistant to the webmaster.  I painfully explain that it's not my problem - but that never seems to endear me to my elders. 

So if anyone has a solution on how to make sure a web page always calls the freshest and most recent beautiful PDF file -- I'll buy you a coffee or something.  I will also tell the real webmaster the solution came to me in a dream -  I was listening to the Beatles "All You Need Is Love" and watching colorful crickets make a masterful representation of HTML and in it was the answer to all our problems.  big_smile (He'll say, chyeah - right! ) 

http://www.northark.edu/students/catalog/index.htm  This is the URL to our problematic page.  Any help appreciated.  I wish my brain had an F5 button...

Thanks!

-7-


WWW>FORMAT///all

Offline

 

#2 2007-12-19 17:48:59

Steven_A_S
Member
From: San Antonio, TX
Registered: 2006-08-07
Posts: 465
I've been thanked 22 times.

Thank me Website

Re: No Store - No Cache - Big Problem

in Linux/Apache you could put the following in the .htaccess file setting the FilesMatch to match pdf files:

Code:

<FilesMatch "\.pdf$">
FileETag None
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, private"
Header set Pragma "no-cache"
Header set Expires "0"
</FilesMatch>

But I notice your server is responding as an IIS server.  The idea though is to send that header information with the pdf file.  The meta tags you're using only affect the html document they're in and the files that are part of it (loaded at the same time).  I'd play around with trying to configure the server to send that header information, but only with those files that you don't want to cache of course.

Hope this helps.

Last edited by Steven_A_S (2007-12-20 09:38:52)

Offline

 

#3 2007-12-19 17:57:21

ColoEagle
Administrator
From: Colorado, USA
Registered: 2006-02-15
Posts: 2127
I've been thanked 86 times.

Thank me Website
Buy me candy

Re: No Store - No Cache - Big Problem

Here is a nice article/tutorial that might help.
http://www.htmlgoodies.com/beyond/refer … hp/3472881


The only way to discover the limits of the possible is to go beyond them into the impossible
Attention designers and webmasters - "The Beauty of CSS"
Valid Web Designs tutorials on HTML, XHTML and CSS
Home Security Systems

Offline

 

#4 2007-12-19 19:33:48

Seven
Member
From: Tattooine
Registered: 2007-10-05
Posts: 59
I've been thanked 2 times.

Thank me Website
Buy me a beer

Re: No Store - No Cache - Big Problem

Yup we're running Windows Server 2003 with IIS.  Hmm, I'll see if they'll be goofy enough to give me remote access to the server again *evil grin.  I don't know Server 2003 and IIS nearly as well as I should.  We have had a lot of struggles with the server this year. 

We actually followed this tutorial: http://www.htmlgoodies.com/beyond/refer … hp/3472881  after the first complaints but found that it just didn't effect the PDF file it was calling. 

There should be something equivalent to .htaccess - it gives me a clue as to how to proceed anyway.


WWW>FORMAT///all

Offline

 

#5 2007-12-20 02:44:27

Northie
Moderator
From: Yorkshire, UK
Registered: 2006-08-19
Posts: 2629
I've been thanked 63 times.

Thank me Website
Buy me a beer

Re: No Store - No Cache - Big Problem

Windows has a problem with server-side caching

Don't just use F5, use Ctrl+F5 for a proper refresh

Also, try sending the no-caching commands as part of the headers, not the html

Code: php

<?php
header('Content-type: application/pdf'); //sending PDF
header('Content-Disposition: attachment; filename="downloaded.pdf"'); //called download.pdf
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1, no cache
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
?>

Now taking free-lance inquiries; Please contact me for more details
Internet Marketing Books
Promote Yourself on Site Reference!

Offline

 

#6 2007-12-20 08:12:17

Ryan_steyn
Member
From: South Africa, Port Elizabeth
Registered: 2006-08-23
Posts: 1743
I've been thanked 31 times.

Thank me 
Buy me a beer

Re: No Store - No Cache - Big Problem

Why not just put a robots file on your server telling everything to ignore the existence of the pdf? It would appear to be a less... urm... mentally intensive solution.


"Humans are by far the most fascinating creatures, in a universe with no boundaries and a world with so much unfound wonder we are the only entities capable of creating boredom"

Offline

 

#7 2007-12-20 09:24:05

Northie
Moderator
From: Yorkshire, UK
Registered: 2006-08-19
Posts: 2629
I've been thanked 63 times.

Thank me Website
Buy me a beer

Re: No Store - No Cache - Big Problem

Ryan_steyn wrote:

Why not just put a robots file on your server telling everything to ignore the existence of the pdf? It would appear to be a less... urm... mentally intensive solution.

Robots has nothing to do with it as this is a browser issue, not a search engine issue

The problem is that the report should be different (nearly) every time someone tries to look at it; but when they do look at it they're seeing an old and out-dated version believing it to be live, current and correct from the server.


Now taking free-lance inquiries; Please contact me for more details
Internet Marketing Books
Promote Yourself on Site Reference!

Offline

 
Never
Sponsored Results


Board footer

Powered by PunBB
© Copyright 2002–2008 Rickard Andersson