在asp.net中清除帧缓存 [英] Clearing the frame Cache in asp.net

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

问题描述

大家好,



我有框架

i我在page_onload方法上加载xyz pdf



i有浏览按钮,从客户端机器中选择pdf并用xyz pdf替换它。

更换服务器后我用新更新的pdf更新我的框架。





这里我的pdf在服务器上被取代了。

但它没有在我的框架中刷新。甚至在将其pdf路径设置为新的pdf之后。

我的新pdf和旧pdf具有相同的文件名。



在研究我发现的是这个pdf是他们在我的浏览器缓存中,我的代码没有清除它。

我尝试了以下所有方法

但它们都没有工作。

i检查我的pdf在服务器上是新的。





Hi all,

I have frame
i am loading xyz pdf on page_onload method

i have browse button which selects pdf from client machine and replaces it with xyz pdf.
after replacing on server i am updating my frame with newly updated pdf.


Here my pdf is getting replaced on server.
but it is not getting refreshed in my frame. even after setting its pdf path to new pdf.
my new pdf and old pdf has same filename.

After researching what i found is this pdf is their in my browser cache and my code is not clearing that.
I tried all of following methods
but none of them are working.
i checked my pdf on server it is new one.


myframe.Dispose();

Response.Cache.SetCacheability(HttpCacheability.NoCache);

myframe.Attributes.Add("src", "");







<meta http-Equiv="Cache-Control" Content="no-cache">
<meta http-Equiv="Pragma" Content="no-cache">
<meta http-Equiv="Expires" Content="0">







当我访问我的浏览器缓存时,它并没有用新的pdf替换旧的pdf。 br />
i不知道为什么它从我的浏览器缓存中读取,即使在提供服务器路径之后,以及它为什么不替换浏览器缓存。



请帮我清理这个缓存。



问候,

SUNIL MALI。




when i went to my browser cache it is not replacing my older pdf with new one.
i dont know why it is reading from my browser cache, even after giving servers path, and why it is not replacing in browser cache.

please help me in clearing this cache.

Regards,
SUNIL MALI.

推荐答案

检查波纹管代码



Check for bellow code

public static void DisablePageCaching()
{
    //Used for disabling page caching
    HttpContext.Current.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1));
    HttpContext.Current.Response.Cache.SetValidUntilExpires(false);
    HttpContext.Current.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);
    HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
    HttpContext.Current.Response.Cache.SetNoStore();
}


检查波纹管代码



Check for bellow code

public static void DisablePageCaching()
{
    //Used for disabling page caching
    HttpContext.Current.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1));
    HttpContext.Current.Response.Cache.SetValidUntilExpires(false);
    HttpContext.Current.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);
    HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
    HttpContext.Current.Response.Cache.SetNoStore();
}


这篇关于在asp.net中清除帧缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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