Sudhanshum
asked on
Caching not stopping on IE
Basically I have asp.net Page,Where I am trying to Stop Caching in my page,I tried following code:
Response.Cache.SetNoServer Caching()
Response.Cache.SetCacheabi lity(Syste m.Web.Http Cacheabili ty.NoCache )
Response.Cache.SetNoStore( )
Response.Cache.SetExpires( New DateTime(1900, 1, 1, 0, 0, 0, 0))
Response.Cookies.Clear()
and my IE browser setting is
Internet Option->Browser history Section->Setting
Then Check for New version for Stored Page section->Never
Still above code is not working.Please tell me how I can fix my issue.I don't get new version until I refresh page.Please reply asap.
Response.Cache.SetNoServer
Response.Cache.SetCacheabi
Response.Cache.SetNoStore(
Response.Cache.SetExpires(
Response.Cookies.Clear()
and my IE browser setting is
Internet Option->Browser history Section->Setting
Then Check for New version for Stored Page section->Never
Still above code is not working.Please tell me how I can fix my issue.I don't get new version until I refresh page.Please reply asap.
ASKER
Basically for testing Caching feature,I enabled caching that way in browser and then I wrote code to see if my code stop caching. Can u plz tell me How I can enable caching on IE and then can see if my code stop caching on IE. We are doing this for Live website testing so if any user browser has caching enabled then also it will not cache our website pages.
please reply asap.
please reply asap.
Nothing on the server can remove pages from the browser cache until the pages expire (in the browser cache) or the user does a refresh. While you can send the appropriate headers to tell the browser not to cache your page, it is actually just a 'request' not a command though it usually does work. The user can set the browser's cache to what they want. Just like you did.
ASKER
Thanks for reply,But I am not looking to remove existing cached items.What I want is if I deleted my browser history and cache,Then after that I don't want my website pages will ever be cached because of code I will use to stop caching.Means if any user browser has enabled caching still my webpage will not be cached.So means after all history deletion,I don't want to maintain cache of my website pages and this i want to do from coding.
Please reply asap.
Please reply asap.
I believe your code is fine... but the browser settings can 'override' your code. And the browser settings are Not your choice. In addition you picked the worst possible setting, 'Never'. 'Never' checking means Always fetching from cache.
IE is normally set to 'Automatic' and that is probably the setting you should test. You can not make the browser users choose a different setting. That is under their control.
IE is normally set to 'Automatic' and that is probably the setting you should test. You can not make the browser users choose a different setting. That is under their control.
ASKER
Thanks for reply But Please tell me that How I will test caching on IE,means How I will check that previously caching was making then I will put my code and that way caching will stop. How I will do this type of setting and testing? Please reply asap.
ASKER
Please reply me asap.
Sorry, I quit and went to bed. The page that you are loading must have something that changes every time for you to check whether caching is occurring. A common item is to put the current date and time at the top of the page.
ASKER
Thanks for reply But What setting I need to do on browser for enabling caching,right now I am testing with one image on page then I m changing image with same name to check caching. but question is how to enable caching on IE? Please reply asap.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks a lot,I will try
You're welcome, glad to help.
I don't know why you would ever do that. That tells your browser to Never expire content in it's cache.