Welcome to WebmasterWorld Guest from 54.145.209.34

Forum Moderators: incrediBILL

Please Don't Cache that PDF

Options to prevent browser from caching PDF?

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

10+ Year Member



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.

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

10+ Year Member



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.
10:54 am on Mar 27, 2004 (gmt 0)

10+ Year Member



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

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

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

10+ Year Member



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.
4:52 pm on Mar 27, 2004 (gmt 0)

10+ Year Member



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.

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

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



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).
11:03 am on Mar 29, 2004 (gmt 0)

10+ Year Member



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.
2:17 pm on Mar 29, 2004 (gmt 0)

10+ Year Member



>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.

 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month