ASP 101 - Active Server Pages 101 - Web06
The Place ASP Developers Go!



Windows Technology Windows Technology
15 Seconds
4GuysFromRolla.com
ASP 101
ASP Wire
VB Forums
VB Wire
WinDrivers.com
internet.commerce internet.commerce
Partners & Affiliates
ASP 101 is an
internet.com site
ASP 101 is an internet.com site
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash



 Top ASP 101 Stories Top ASP 101 Stories
Connections, Commands, And Procedures
What is ASP?
VBScript Classes: Part 1 of N

QUICK TIP:
Connection Pooling lightens the load
Show All Tips >>
ASP 101 RSS Feed ASP 101 Updates


Quick Tips


Bust Caching Once and For All

There are times when caching of your pages by browsers, proxy servers, and caching appliances can be a life saver. In general caching is a very good thing but, it can also be a real pain when it occurs at the wrong time. For those times when caching just is not acceptable, try this...

Almost all page caching is based upon the URL of the page. Therefore if you append a parameter that always changes to the url of the page you're linking to, it'll ensure that the page is freshly retreived when that link is followed. What you use to do this is up to you, but something as simple as a random number or a timestamp works fine for the most part.

<a href="http://www.asp101.com/?cachebust=<%= Server.URLEncode(Now()) %>">ASP 101</a>

will result in a link that looks like this:

http://www.asp101.com/?cachebust=7%2F10%2F2001+5%3A01%3A37+PM

that passes the cachebust parameter and results in the link that is generated being unique every time the page is loaded. What the caching servers don't know is that the parameter is meaningless. As long as it varies they have no way of determining if it's important or not to your asp page and so they're forced to pass the request back to the original server in order to get a response.


Thanks for the prompting to write this tip goes to Yahav Braverman (Shadow Wizard)


Previous      Show All Tips      Next

If you have a tip you would like to submit, please send it to: webmaster@asp101.com.


Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers