how to disable cache? [duplicate] - asp.net

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
asp.net mvc disable browser cache
how to disable cache for a method in asp.net mvc3?
Problem in IE9
I am saving some data on /home/ page. The page saves data and reload the page to show the newly updated result. In other browsers FF/Opera page refresh is getting new results but on IE9 its showing old data.

Response.Cache.SetCacheability(HttpCacheability.NoCache);

Just reload the page with some random parameter.
Like: /home/?rd=2823772
Make sure to always change the rd parameter to another random number on each reload. This way, IE9 will not have the page cached and it'll refresh like FF/Opera.

Related

Revalidate key in Next.js [duplicate]

This question already has answers here:
How does the revalidate process in Incremental Static Regeneration work?
(2 answers)
Closed 7 months ago.
As you know, we can update SSG page via revalidate key in getStaticProps() and user at firstly see latest content and after refresh page twice can see updated content.
But is it proper that user should refresh page twice? In my opinion, user do not know should refresh twice. However, new users can see the new content at first.
I would be appreciate if share your comments about revalidate.
You'll usually have more than 1 user. The Re-generation can be triggered by any of your users so not everyone on the site needs to refresh twice. Only 1 user would do that.

Is there any Better way to reflect the changed CSS code on user end rather than telling them please clear your cache to see the update? [duplicate]

This question already has answers here:
Force browser to clear cache
(21 answers)
Closed 2 years ago.
I have a website. When I Change something to the style sheet the effect does't fall into user's browser.Then when they clear their cache that new style sheet reflects to then.So my is there any better way to reflect that change whenever I update my code ??
My go-to solution would be to set the Cache-Control header's max-age to something like 5 mins. That way users navigating on your page don't have to load the stylesheet each time, but when they come back like an hour later, it is reloaded.
Another way would be to increment a version number as a get parameter on the end of your stylesheet url each time you make changes to the stylesheet:
<link href="/styles/home.css?version=1" rel="stylesheet">
When you increment the version number, the browser thinks it's a different resource and reloads it.

Losing session variable, classic asp, iis7, url rewrite ie 10 & 11

This is the strangest problem and is driving me crazy.
We had an online questionnaire and I decided to split it up as opposed to having it in one long form.
The form submits to the same page, at the top of the page it checks which page it is on, reads in the data from the previous page and stores it in a session variable (an array). There are also a couple more session variables that sum up the answers etc.
It reads in the data perfectly but when the page is submitted again the session seems to lose the previous data and only has the newer information.
This is the curious bit. It works perfectly in chrome, firefox, safari and older versions of ie.
It also works in ie10 / 11 when i browse directly to the page e.g. questionnaire.asp but when I access the page via a url rewrite /questionnaire/stage-1 it fails to hold the session variables but again only in ie10 and 11.
This is driving me crazy. I can see any issues in the code so I feel it is something else maybe relating to how ie works with session variables with iis7 / url rewrite!
Going mad here!
Thanks
Maybe you just need to set the expiration time of session variables.
Try code below:
<% Session.Timeout=120 %>
That is in minutes.

How to Update a Facebook Like button [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Facebook share url thumbnail problem
How to clear Facebook Sharer cache?
I placed a Facebook Like button on my website about 7 days ago. It seemed to work fine; except several days later I noticed that it was giving out the wrong meta data in the Facebook message that is sent. The Title, the Description and the Canonical URL were all wrong. Mea Culpa. It was my fault. I had cloned an old page to save time, had changed the content but had forgotten to change the Meta data at the top. Easy to fix, right. Edit the html page. WRONG. Made no difference. Deleted the Like button code, and re-created a new Like button on the Facebook Developers website and pasted the new code. Made no difference. The button still shows the Meta data from the first button.Tried different variations of button code. Made no difference whatever. It seems the original data has been cached in the Facebook database, and cannot be changed.
Any help somebody?
Load the URL in the Facebook debugger. That might flush the cache.
You should probably try changing URL with a query string in the end.
Also, URL Linter provides you an insight on how FB is going to read your like Meta Tags.
it is always a good practice to check your like page URL here and see what all Meta Tags FB is picking up ..
http://developers.facebook.com/tools/debug

what is the purpose of a css link placed like this style.css?23409823098 [duplicate]

This question already has answers here:
Closed 14 years ago.
Duplicate of what does do in a css link
I've seen a few sites who list a stylesheet with parameters in it.
does anyone know what its called and what purpose they serve?
ex:
href="fonts.css?1169659562000"
The parameter is changed every time the content of the file changes. This allows the site hoster to set an infinite cache timeout, which keeps the browser from re-requesting the CSS. Without the parameter, updates would never reach the client.
See also the Stackoverflow Podcast #38 and the YSlow tool.
To force the browser to refresh the CSS link. It's more reliable than expires headings and the like.

Resources