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

Windows Technology Windows Technology
15 Seconds
ASP 101
ASP Wire
VB Forums
VB Wire
internet.commerce internet.commerce
Partners & Affiliates
ASP 101 is an site
ASP 101 is an site
Internet News
Small Business
Personal Technology

Corporate Info
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

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="<%= Server.URLEncode(Now()) %>">ASP 101</a>

will result in a link that looks like this:

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:

Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback
The Network for Technology Professionals



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