问题
Mono MVC2 application uses controller below to cache order page in browser.
If F5 is pressed in browser, old page is still returned to browser. How to return fresh page if F5 is pressed ? It looks like page is cached in server but OutputCacheLocation.Downstream must cache page only in borwser. Is this bug?
[Authorize]
public class DetailController : ControllerBase
{
[OutputCache(Location = OutputCacheLocation.Downstream, Duration = 20 * 60,VaryByParam = "_entity")]
public ActionResult Index(string _entity, int? orderId)
{
...
回答1:
I think you may be missing the whole point of caching. Pressing F5
will continue to return the cached page until it has expired (20 mins in your case). If you want to force the server to send the page again you would need to do a hard refresh e.g. Ctrl
+ F5
来源:https://stackoverflow.com/questions/13120734/how-to-get-fresh-copy-if-outputcachelocation-outputcachelocation-downstream-i