homepage Welcome to WebmasterWorld Guest from 50.16.165.62
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Please Don't Cache that PDF
Options to prevent browser from caching PDF?
mikegram




msg:589082
 12:34 am on Mar 27, 2004 (gmt 0)

My company puts out a weekly newsletter in PDF. Some users complain that the new issue isn't posted in a timely manner when, in fact, it is. I'm familiar with a number of methods for preventing HTML from being cached, but is there a way to stop the cache of a PDF?

I'm told the server is a 'mainframe' running iPlanet. I have little knowledge and very limited access. Would prefer a file or download related solution, but will pursue server-settings solutions if anyone knows anything about it.

Read something about results of the POST method not being cached. Is this true? Can you set up a download using a FORM submit button with METHOD=POST and avoid browser caching?

Soliciting any and all information. I can find nothing on this. Thank you.

 

danieljean




msg:589083
 2:11 am on Mar 27, 2004 (gmt 0)

If the new newsletter doesn't have the same file name, you don't have the caching problem. You'll just need to update the link to the latest newsletter so it's always linking to the latest issue.

dcrombie




msg:589084
 10:54 am on Mar 27, 2004 (gmt 0)

Instead of changing the filename, you can add a timestamp to the newsletter link.

eg. <A href="newsletter.pdf?20040326">Newsletter</A>

nafmo




msg:589085
 12:55 pm on Mar 27, 2004 (gmt 0)

If you post your newsletter on a specific time, you should probably add an Expires header so that the old one isn't valid when the next is published.

mikegram




msg:589086
 4:52 pm on Mar 27, 2004 (gmt 0)

Daniel, changing the filename would be a simple and effective solution. I'm told that new files require some extra steps by our server admin to make them publicly accessible. A small point, but I'm hoping to avoid creating extra work for anyone else.

Dcrobie, what exactly would be the effect of the timestamp and is this solution server specific?

Nafmo, where would I put this and what does the syntax look like?

Thanks very much for all the ideas.

g1smd




msg:589087
 9:23 pm on Mar 28, 2004 (gmt 0)

Oooh. As a user I would be annoyed if every edition was called newsletter.pdf each time - I think that you should date them individually: newsletter.2004.03.28.pdf etc, to solve both problems (Use Y-M-D date so that they automatically sort into the correct date order in directory listings).

dcrombie




msg:589088
 11:03 am on Mar 29, 2004 (gmt 0)

URL's with GET parameters are not cached in most circumstances. Some older browsers cache the file including the GET parameters but by using 'YYYYMMDD' each day you get around that as well.

danieljean




msg:589089
 2:17 pm on Mar 29, 2004 (gmt 0)

>Daniel, changing the filename would be a simple and effective solution.

Exactly. I'm a lazy programmer (as all good ones ought to be), and that's the easiest solution by far.

If the admin is remotely competent, have them make a /newsletter directory that is publicly accessible. If you are causing them less work than you save yourself, you shouldn't feel bad.

Using the naming convention that g1smd suggested would be great, both for yourself and users.

Also, if you have access to even a light scripting language, you should be able to have the newsletters page automatically update as soon as you upload the newsletter.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved