Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Caching / October 2006

Tip: Looking for answers? Try searching our database.

Stop browser and server caching

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
steven scaife - 10 Oct 2006 09:32 GMT
A quick question, I am trying to get a page in a site i am developing to stop
caching I have tried adding the OutPutCache Location="none" tag to the page
and the HTML tags that handle browser caching but these don't work as
expected.  

I have a page where they click on a product from the navigational menu, it
then stores the dataset in a session variable because some products have more
than 5 products so a paging routine is implemented, however if they use there
back button onthe browser and look at a previous product they have clicked on
then the session variable has been overwritten by the current product they
looked at.  If there is only one page for the current product but 5 pages for
the previous product then it errors because the currentpageindex is greater
than the pagecount, if there is more than one page then it pages through the
wrong set of products.  I need to stop them from being able to look at the
previous product, i am assuming that if the page shows a message that the
content is no longer valid and they refresh the content it should pull the
right data through, it passes the product ID through the querystring so it
should be able to find the right data.

The only thing i can think of is javascript to clear the history when the
user views a product page, the only problem with this is a lot of web users
don't like that and I want to make the user experience as friendly as
possible.

thanks in advance for any suggestions
offwhite - 10 Oct 2006 22:28 GMT
It appears you are mixing 2 problems.

You can disable OutputCache by simply removing the directive from your
page.  What I normally do is place the content which can be cached into
User Controls (.ascx) with an OutputCache directive while the pages
(.aspx) hold them are not cached.

Your other problem is trying to control history and back button.  That
is something many web developers have failed to do because it is not
meant to be done.  You will not be able to reliably prevent someone
from using their back button to get to a previous page.

You have to make the decision on whether you are building a "web site"
or a "web application."  If you are building the application you may
want pop a fresh window with no navigational controls and handle all
navigation through your own means.  Such an approach is hardly
reasonable for the average web user who will be uneasy about missing
their back and forward buttons.

Here is a good overview of the problem.

http://ajaxian.com/archives/handling-usability-concerns-such-as-the-back-button-
and-bookmarking


Brennan Stehling
http://brennan.offwhite.net/blog/

> A quick question, I am trying to get a page in a site i am developing to stop
> caching I have tried adding the OutPutCache Location="none" tag to the page
[quoted text clipped - 21 lines]
>
> thanks in advance for any suggestions

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.