• 数据库缓存


    一:缓存(自定义缓存)(掌握)
    将数据从数据库/文件取出来放在服务器的内存中,这样后面的用户来获取数据,不能查询数据库,直接从内存
    (缓存)中获取数据,提高了访问速度,节省了时间,也减轻了数据库的压力

    缓存是空间换时间的技术

    什么样的内容适合放缓存中
    经常被查询,但是不是经常改动的数据

    分布式缓存
    缓存是网址优化的第一个手段

    cache 与session的区别
    每个用户都有自己单独的session,对象
    但是cache的数据是大家共享的


    三:页面缓存 (掌握)

     1 服务器端
     2  protected void Page_Load(object sender, EventArgs e)
     3         {
     4             BLL.UserInfoService UserInfoService = new BLL.UserInfoService();
     5           UserInfo userInfo= UserInfoService.GetModel(int.Parse(Request.QueryString["Id"]));
     6           List<UserInfo> list = new List<UserInfo>();
     7           list.Add(userInfo);
     8           this.DetailsView1.DataSource = list;
     9            this.DetailsView1.DataBind();
    10         }
    11 
    12 客户端
    13 
    14 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ShowDetailCache.aspx.cs" Inherits="CZBK.TestProject.WebApp._2014_11_17.ShowDetailCache" %>
    15 
    16 <%@ OutputCache Duration="5" VaryByParam="*" %> 页面缓存 如果是none的话,则id 都是1
    17 <!DOCTYPE html>
    18 
    19 <html xmlns="http://www.w3.org/1999/xhtml">
    20 <head runat="server">
    21 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    22     <title></title>
    23 </head>
    24 <body>
    25     <form id="form1" runat="server">
    26     <div>
    27         <asp:DetailsView ID="DetailsView1" runat="server" Height="105px" Width="506px"></asp:DetailsView>
    28     </div>
    29     </form>
    30 </body>
    31 </html>

    四 数据源缓存 (了解)

    五 文件缓存依赖(了解)

      微软AJAX(了解)(ToolKit)

  • 相关阅读:
    小心使用宏
    常见文件、目录、路径操作函数
    链表法页框的分配和去配
    获取调试符号文件
    Visual C++ Runtime Error 调试
    HEAP: Free Heap block XXXX modified at XXXX after it was freed
    磁盘操作 API
    【转】浅谈大型网站动态应用系统架构 Mr
    jQuery1.3.1 Tab选项卡 Mr
    spring依赖注入思想 Mr
  • 原文地址:https://www.cnblogs.com/liuweiqiang11188/p/6686074.html
Copyright © 2020-2023  润新知