如何确定ASP.NET页面是否在缓存中?

时间:2022-12-15 01:51:14

I need to find whether the web page is cached or not. That s loaded newly or its appeared in cache.

我需要找到网页是否被缓存。这是新加载的或它出现在缓存中。

2 个解决方案

#1


3  

Include generated timestamp somewhere in your response, and store the the timestamp somewhere in the server (maybe in the cache object). That way you know the version of the page by examining those values.

在响应中的某处包含生成的时间戳,并将时间戳存储在服务器中的某个位置(可能在缓存对象中)。这样,您可以通过检查这些值来了解页面的版本。

If you could elaborate more on the scenario you're facing, I'm sure you'll get better answer.

如果你能详细说明你所面临的情景,我相信你会得到更好的答案。

#2


1  

You have either client-side or server-side caching and these are discrete in that they have no knowledge of each other.

您有客户端或服务器端缓存,这些是离散的,因为他们彼此不了解。

On the server-side examine the Response.Cache object.

在服务器端检查Response.Cache对象。

#1


3  

Include generated timestamp somewhere in your response, and store the the timestamp somewhere in the server (maybe in the cache object). That way you know the version of the page by examining those values.

在响应中的某处包含生成的时间戳,并将时间戳存储在服务器中的某个位置(可能在缓存对象中)。这样,您可以通过检查这些值来了解页面的版本。

If you could elaborate more on the scenario you're facing, I'm sure you'll get better answer.

如果你能详细说明你所面临的情景,我相信你会得到更好的答案。

#2


1  

You have either client-side or server-side caching and these are discrete in that they have no knowledge of each other.

您有客户端或服务器端缓存,这些是离散的,因为他们彼此不了解。

On the server-side examine the Response.Cache object.

在服务器端检查Response.Cache对象。