InASP.NET1.0,abugcausedcachedpagesthatspecifiedLocation="ServerAndClient"asanoutput–cachesettingtoemitaVary:*HTTPheaderintheresponse.Thishadtheeffectoftellingclientbrowserstonevercachethepagelocally.
InASP.NET1.1,theSystem.Web.HttpCachePolicy.SetOmitVaryStarmethodwasadded,whichyoucouldcalltosuppresstheVary:*header.ThismethodwaschosenbecausechangingtheemittedHTTPheaderwasconsideredapotentiallybreakingchangeatthetime.However,developershavebeenconfusedbythebehaviorinASP.NET,andbugreportssuggestthatdevelopersareunawareoftheexistingSetOmitVaryStarbehavior.
InASP.NET4,thedecisionwasmadetofixtherootproblem.TheVary:*HTTPheaderisnolongeremittedfromresponsesthatspecifythefollowingdirective:
<%@OutputCacheLocation="ServerAndClient"%>
Asaresult,SetOmitVaryStarisnolongerneededinordertosuppresstheVary:*header.
InapplicationsthatspecifyLocation="ServerAndClient"inthe@OutputCachedirectiveonapage,youwillnowseethebehaviorimpliedbythenameoftheLocationattributesvalue–thatis,pageswillbecacheableinthebrowserwithoutrequiringthatyoucalltheSetOmitVaryStarmethod.
欢迎光临 仓酷云 (http://ckuyun.com/) | Powered by Discuz! X3.2 |