3044am永利(集团)科技有限公司 - 百度百科

 
           
       
Baidu
sogou
   


òͬиóõͬͼʾChromeܹʾʵʱʱ䣬IEʾʱ䶼ͬġ



 






 




ͨΪURLַӺ׺ķʽ
IEAjaxķصĽǸַлģϣЧǿÿʱΪַӲͬĺ׺⡣ӣͨµĴΪַһڵǰʱIJѯַٴгIEнʾʵʱʱ䡣


ƴ :


   
   
               
           
       
   



ͨjQueryAjaxý
ʵjQueryAjaxãֻҪµķʽ$.ajaxSetupֹAjazĻơ


ƴ :


 
   
               
           
       
   



ʵjQueryҲͨΪַӲͬIJѯַ׺ʵֵģͨFiddlerص֤ʵ




 




ġͨӦ
ǿͨӦԽĻ棬ΪǶһΪNoCacheAttributeActionFilterʵֵOnActionExecutedУǵõǰHttpResponseSetCacheabilityѡΪNoCacheNoCacheAttributeԱӦõGetCurrentTimeǵijIEȻԵõʵʱʱ䡣


ƴ :


 public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }

        [NoCache] 

        public string GetCurrentTime()
       {
           return DateTime.Now.ToLongTimeString();
       }
   }
   public class NoCacheAttribute : FilterAttribute, IActionFilter
   {
       public void OnActionExecuted(ActionExecutedContext filterContext)
       {
         filterContext.HttpContext.Response.Cache.SetCacheability(HttpCacheability.NoCache);
       }

       public void OnActionExecuting(ActionExecutingContext filterContext)
       {}
   }
 


ʵNoCacheAttributeտϢϢCache-ControlͷΪno-cacheָʾҪԽл档ʾGetCurrentTimeӦϢ


ƴ :


 HTTP/1.1 200 OK
    Server: ASP.NET Development Server/10.0.0.0
    Date: Thu, 03 Jan 2013 12:54:56 GMT
    X-AspNet-Version: 4.0.30319
    X-AspNetMvc-Version: 4.0
    Cache-Control: no-cache 

    Pragma: no-cache
    Expires: -1
    Content-Type: text/html; charset=utf-8
   Content-Length: 10
   Connection: Close

   8:54:56 PM

һƪɽҵվǶ۰ٶ̻ᵹ
һƪɽվAJAX ĻЧ
Baidu
sogou