简体   繁体   English

我可以仅缓存最后访问的页面吗?

[英]Can I cache just the last page visited?

有没有一种方法可以像浏览器一样仅缓存客户端在MVC中访问的最后一页,还是我需要使用JavaScript并使用浏览器功能?

You can cache the previous page on the server (output caching), but there's no way to refer to it from the next page. 您可以在服务器上缓存上一页(输出缓存),但是无法从下一页引用它。

Would something like cross-page posts work for you? 跨页面帖子之类的内容对您有用吗? They reconstruct the state of the controls on the previous page, and make them accessible to the current page. 它们在上一页上重建控件的状态,并使它们可用于当前页面。

Information from a previous page is normally considered "state" information -- as such, one alternative is to use cookies or Session state to store the information you need to carry over. 前一页中的信息通常被视为“状态”信息-因此,一种替代方法是使用Cookie或会话状态来存储您需要保留的信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 重定向到上次访问的页面(存储在cookie中) - Redirect to last visited page (stored in a cookie) 会话结束后将用户重定向到他最后访问的页面,然后重新登录 - Redirect user to his last visited page after session ends and relogin 访问上一页 - Getting previous page visited 如何确保浏览器不缓存页面 - How can I ensure that the browser does not cache a page 如何使用 outputcache 缓存自定义错误页面 - How can I cache customerror page using outputcache 前五页访问Cookie - Last Five Pages Visited Cookie 如何在最后一页中添加PdfPTable作为页脚? - how can I add a PdfPTable as footer in last page? 我可以创建一个用户控件,它只是一个面板,单击按钮后可以插入到ASP页面? - Can I create a User Control that is just a panel that I can insert to an ASP page when a button is clicked? 如何在多个回发期间阻止页面存储在缓存中? 称为smartnavigation的东西 - How can I prevent a page to be stored in cache during multiple postbacks? Something known as smartnavigation 我为什么可以通过浏览器的后退按钮导航到页面,尽管cache = disable? - Why can I navigate to a page via browser's back button though cache = disabled?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM