删除页面的缓存 [英] removing cache for page

查看:86
本文介绍了删除页面的缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在全国各地有100多个用户同时工作.
有孤立的方案,其中当他们保存记录时,它保存了其他用户的旧信息.

我想在页面加载时有一个初始化阶段,其中页面上的所有缓存都将被删除,因此它将以新的形式启动,并避免将旧的数据保存到数据库中.

请提供最佳做法或方法的帮助.尽管已经隔离了这个问题,但对于关键数据却出现了问题,对此感到非常疲倦.

如果实施此方法,还会有弊端或弊端吗?

问候
Dabsukol

I have more than 100 users working at the same time throughout the country.
There are isolated scenarion wherein when they save the record, it saved the old information of other users.

I want to have a initialization stage on page load wherein all cache on page will be removed so it will start as new and to avoid getting old data saved into the database.

Please help on what is the best practice or approach. Reaelly tired of this problem though its isolated but problem occurs on critical data.

One more is there any draw back or cons if I implement this?

Regards
Dabsukol

推荐答案

在这些方面可能还会更多....?

用户1和用户2都希望处理同一条记录

*用户1进入页面并开始更改数据.
*在用户1提交任何更改之前,用户2也进入页面并开始修改数据
*用户1提交更改,更新数据库记录.
*用户2此时*并不知道记录已被更新*.
*用户2提交更改.当用户1和用户名1更改为用户2时,用户2的值将覆盖用户1的更改. 2都开始在页面上工作,并且用户2进行了任何更改.

这是一个并发问题,而不是一个缓存问题,有很多不同的处理方式.通读其中一些链接或Google

http://www.codeguru.com /csharp/.net/net_data/article.php/c19655/Handling-Concurrency-Issues-in-NET.htm [ http://msdn.microsoft.com/en-us/magazine/cc163924.aspx [ ^ ]
Could it be more along these lines....?

User 1 and User 2 both want to work on the same record

* User 1 enters the page and begins changing data.
* Before User 1 has submitted any changes, User 2 also enters the page and starts amending data
* User 1 submits changes, updating the database record.
* User 2 at this point *is unaware that the record has been updated*.
* User 2 submits changes. User 2 will overwrite Users 1''s changes with whatever the values were when Users 1 & 2 both started working on the page, and whatever changes User 2 made.

This is a concurrency issue rather than a caching issue, there are lots of different ways of handling this. Have a read through some of these links, or Google

http://www.codeguru.com/csharp/.net/net_data/article.php/c19655/Handling-Concurrency-Issues-in-NET.htm[^]

http://msdn.microsoft.com/en-us/magazine/cc163924.aspx[^]


Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();
Response.Cache.SetExpires(DateTime.MinValue);


将此代码放在母版页中.
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();
Response.Cache.SetExpires(DateTime.MinValue);


put this code in master page.


这篇关于删除页面的缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆