Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是初学者,我无法弄清楚以下情况。我在 pageindexchange 事件中有一个 do databind() 函数,在使用 gridview 更改页面索引时在服务器上再创建一个会话。当我们在会话中存储gridview的源代码时?
会话为每个用户创建一次。这意味着如果您将网格数据存储在会话中,您会增加每个新用户的内存消耗。
还有其他选择。如果数据从不更改或很少更改,您可以将其缓存在共享容器(httpcache、应用程序)中。如果每个用户的数据不同,不要缓存它,在每个请求中从数据库中读取它。