??? ??? ????? ?? ASP.NET ???????? Visual Basic .NET

?????? ????????? ?????? ?????????
???? ???????: 811431 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

??????

???? ??? ??????? ???? ????? ????? ?????? ?? ????? ASP.NET ?????? ????? ??? ?????? ????????. ?????? ??????? ???? ????? ????? ??????? ??? ????? ??????? ???????. ??????? ?????? ????? ???? ?????? ??????? ?????? ??????? ????? ????. ?? ??? ????? ?????? ????? ????? ?????? ???????? ?? ??????? ?? ????? ?? ?????? ?? ???????. ????? ????? ??? ??????? ??? ???? ??? ?? ??? ?????? ?????? ?? ??? ????????.

??????? ????

???? ASP.NET ?????? ?????? ?????? ?? ??????? ??????. ????? ??????? ??????? @ OutputCache ?????? ?? ??????? ?????? ?? ASP.NET ????? ??????. ?????? ????? HttpCachePolicy ?????? ??????? ????????? ??? datasets ??? ????? ??????. ????? ????? ????? ??????? ?????? ?? ??????? ??? ?????? ?????? ?????? ?????? ? ????? ??????? ?????? ?? Microsoft (IIS). ????? ?????? ?? ??????? ?????? ???????? ??? HTTP Cache - Control (?????? ?? ??????? ??????.

?????? ??? ??????? ?????? ??? ????? ??????? ?????? ??????? ?? ASP.NET ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft:
308516????? ??????? ?????? ?????? ??????? ?????? ?? ASP.NET ???????? Visual Basic .NET

????? ASP.NET ????? ??????? ??????

???? ????? ???????? ??????? @ OutputCache ?? ??????? ???? ????????? ???????? ???????? Visual Basic .NET ?? Visual C# .NET. ????? OutputCache @ ????? ??? ??? ??????. ??? ????? ????? ???? ???? ????? ??????? ??????. ????? ????? ??? ??????? ???????:
  • ?? - ??? ?????? ????? ??????? ??????? ??????? ?? ?????? ????????? ??? ?????? ?????? (?? ?? ????) ????? ?? ????? ?? ??? ?????? ??? ??? ?????? ?????. ?????????? ?? ?????.
  • ?????? - ??? ?????? ????? ??????? ??????? ?????? ??? ?????? ??????.
  • Downstream - ??? ?????? ????? ??????? ??????? ??????? ?? ??? ????? ????? ??? ????? ??????? ?????? (????? ?? ???? ?????) ???????? ?? ?????.
  • ?????? - ??? ?????? ????? ??????? ??????? ?????? ??? ???? ???.
  • ??? - ??? ???? ????? ??????? ??????? ???????.

???? ??? ????? ????????? ???????? ?? @ OutputCache ????? ???? ??????? ??????.
  • ????? ????? ??????? ??????? ?????? ??? ???????

    ???? ????????:
    <%@ OutputCache Duration="60" VaryByParam="None" %>

    ???? ???????:
    Response.Cache.SetExpires(DateTime.Now.AddSeconds(60))
    Response.Cache.SetCacheability(HttpCacheability.Public)
  • ????? ????? ??????? ??????? ?????? ??? ?????? ???????? ??? ?? ????? ?????

    ???? ????????:
    <%@ OutputCache Duration="60" Location="Client" VaryByParam="None" %>

    ???? ???????:
    Response.Cache.SetExpires(DateTime.Now.AddSeconds(60))
    Response.Cache.SetCacheability(HttpCacheability.Private)
    
  • ????? ????? ??????? ??????? ?????? ??? ??? ????? ????? ??? ????? ??????? ?????? HTTP 1.1 ??? ?? ??? ???????? ??????? ?????? ???? ???? ???

    ???? ????????:
    <%@ OutputCache Duration="60" Location="Downstream" VaryByParam="None" %>

    ???? ???????:
    Response.Cache.SetExpires(DateTime.Now.AddSeconds(60))
    Response.Cache.SetCacheability(HttpCacheability.Public)
    Response.Cache.SetNoServerCaching()
  • ????? ????? ??????? ??????? ?????? ??? ???? ???

    ???? ????????:
    <%@ OutputCache Duration="60" Location="Server" VaryByParam="None" %>

    ???? ???????:
    Response.Cache.SetExpires(DateTime.Now.AddSeconds(60))
    Response.Cache.SetCacheability(HttpCacheability.Server)
    
  • ????? ??????? ?? ??? HTTP ???? ??? ?? ????? ??????

    ???? ????????:
    <%@ OutputCache duration="60" varybyparam="City" %>
    

    ???? ???????:
    Response.Cache.SetExpires(DateTime.Now.AddSeconds(60))
    Response.Cache.SetCacheability(HttpCacheability.Public)
    Response.Cache.VaryByParams("City") = true
    
    ??? VaryByCustom ? ??? VaryByHeader ? ??? ' VaryByParam ' ?? ??????? @ OutputCache ???? ????? HttpCachePolicy ??????? VaryByHeaders ? ??????? VaryByParams ????? SetVaryByCustom.

????? ????? ???? ??????? ??????? ??????

?????? ????? ????? ??????? ??????? ?????? ????? ??? ASP.NET ?? ???? ???? ??? ?????? ?????? ????? ???? ????? ?????? ??? ?? ?? ?? ?????? ???? VaryByParam ??? ??? ?? ????? OutputCache @. ??????? ????? ???????? ???????? ??????? ?????? ????? ???? ??????? ??????? ??????.
  • ???? ????????:
    <%@ OutputCache Location="None" VaryByParam="None" %>
  • ???? ???????:
    Response.Cache.SetCacheability(HttpCacheability.NoCache)

????? ??????? ?????? ?????? ?????? ?? ????? ??????

????? ASP.NET ???? ??????? ?????? ????? ? ???? ????????? ???? ????? ????????? ?????? ???????? ???? ????? ???? ?? ????? ?????? ?????? ?? ???????. ??? ??????? ?????? ?????? ??? ???????. ?????? ???? ?? ????? ????? ?????? ????? ??????? ???????. ?????? ???????? ??????? ?? ASP.Net ???????? ??? ??????? ?????? ? ???? ??????? ???????:
  1. ????? ????? ??? ASP.NET ???? ???????? Visual Basic .NET.
  2. ?????????? ??? ????? WebForm1.aspx.
  3. ?? ????? ??? HTML WebForm1.aspx ? ?????? ????????? ???????? ???????? ????? ????????? ???????? ??????:
    <%@ Import Namespace="System.Data.SqlClient" %>
    <%@ Import Namespace="System.Data" %>
    <HTML>
    	<script language="vb" runat="server">
    
    		Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
    			Dim Source As DataView
    
    		'Retrieve the DataView object from the Cache class. If it does not exist, add the DataView object to the Cache class.
    
    		Source = CType(Cache("MyDataSet"), DataView)
    
    		If Source Is Nothing Then
    
    			Dim myConnection As SqlConnection = New SqlConnection("Server=ServerName; database=Pubs; user id=UID; password=PWD;")
    			Dim myCommand As SqlDataAdapter = New SqlDataAdapter("select * from Authors", myConnection)
    			Dim ds As DataSet = New DataSet()
    			myCommand.Fill(ds, "Authors")
    
    			Source = New DataView(ds.Tables("Authors"))
    			Cache("MyDataSet") = Source
    			CacheMsg.Text = "Dataset created explicitly"
    			
    		Else
    			
    			CacheMsg.Text = "Dataset retrieved from cache"
    
    		End If
    
    		' Bind the DataView object to DataGrid. 
    		MyDataGrid.DataSource = Source
    		MyDataGrid.DataBind()
    
    		End Sub
    
    	</script>
    	<body>
    		<form method="GET" runat="server" ID="Form1">
    	      <h3><font face="Verdana">Caching Data</font></h3>
    			<ASP:DataGrid id="MyDataGrid" runat="server"
    			Width="700"
    			BackColor="#ccccff"
    			BorderColor="black"
    			ShowFooter="false"
    			CellPadding=3
    			CellSpacing="0"
    			Font-Name="Verdana"
    			Font-Size="8pt"
    			HeaderStyle-BackColor="#aaaad" />
    			<p>
    			<i><asp:label id="CacheMsg" runat="server"/></i>
    	    </form>
    		</P>
    	</body>
    </HTML>
    ?????? ??????? ????? ServerNameUID ? PWD ?? ????? ???????? ???????? ????? SqlConnection ?? SQL Server ????? ? ????? ???????? ? ???? ??????.
  4. ?? ??????? ????? ? ???? ??? "????" ?????? ???????.

    ?????? ??? ????? ????? ??????? ????? ????? ???? Cached.

?????

?????? ??? ??????? ??????? ???? ??? ????? ???????? ??????? ?????? ?? "????? ??????? ?? Microsoft:
234067????? ??? ??????? ?????? ?? Internet Explorer
247404????? ????? ??? Cache - Control (?????? ?? ??????? ?????? HTTP ??? ??????? IIS
311006????? ??? ??????? ?????? ??? ?? Windows 2000
247389IIS: ????? ????? ??????? ?????? ????? MIME ?????
313561????? ????? ???? HTTP ?????? ?????? ??????? ?? IIS


????? ?? ?????????? ?? ?????? ???? Microsoft ?????? ??? ?????:
http://msdn2.microsoft.com/en-us/library/xsbfdd8c(vs.71).aspx


???????

???? ???????: 811431 - ????? ??? ??????: 14/????? ??????/1428 - ??????: 3.6
????? ???
  • Microsoft ASP.NET 1.1
  • Microsoft ASP.NET 1.0
  • Microsoft Visual Basic .NET 2003 Standard Edition
  • Microsoft Visual Basic .NET 2002 Standard Edition
????? ??????: 
kbmt kbhowtomaster kbdatabinding kbcaching kbwebforms kbinfo KB811431 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????811431

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com