如何在内存和磁盘上设置缓存限制的ASP文件 [英] How to set Cache limited ASP files in memory and on disk
本文介绍了如何在内存和磁盘上设置缓存限制的ASP文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我想更改内存和磁盘上有限ASP文件的设置。
不可编辑在IIS 7.5中。
我想知道这些设置的备用。
解决方案
试试这个:
缓存页面
<%@ OutputCache 持续时间 = 60 位置 = 客户端 VaryByParam = < span class =code-keyword>无 %>
Response.Cache.SetExpires(DateTime.Now.AddSeconds( 60 )) ;
Response.Cache.SetCacheability(HttpCacheability.Private);
碎片整理缓存:
<%@ OutputCache duration = 60 varybyparam = 城市 %>
Response.Cache.SetExpires(DateTime.Now.AddSeconds( 60) 跨度>));
Response.Cache.SetCacheability(HttpCacheability.Public);
Response.Cache.VaryByParams [ City] = true ;
根据输入参数缓存
让我们试试这一页。
Web.config
< 配置 >
< location path = showStockPrice.aspx >
< system.webserver >
< cach ing >
& lt; profiles& gt;
< add < span class =code-attribute> varybyquerystring = * location = 任何 持续时间 = 00:00:01 policy = CacheForTimePeriod 扩展名 = .aspx >
& lt; / profiles& gt;
< / add > < / caching >
< / system.webserver >
< / location >
< / configuration > 跨度>
Hi All,
I want to change the setting of limited ASP files in memory and on disk.
It is non editable in IIS 7.5.
I want to know the alternate for these settings.
解决方案
Let try this:
Cache page
<%@ OutputCache Duration="60" Location="Client" VaryByParam="None" %> Response.Cache.SetExpires(DateTime.Now.AddSeconds(60)); Response.Cache.SetCacheability(HttpCacheability.Private);
Defragment cache:
<%@ OutputCache duration="60" varybyparam="City" %> Response.Cache.SetExpires(DateTime.Now.AddSeconds(60)); Response.Cache.SetCacheability(HttpCacheability.Public); Response.Cache.VaryByParams["City"] = true;
It is cached based on input parameter
Let try this for all page.
Web.config
<configuration> <location path="showStockPrice.aspx"> <system.webserver> <caching> <profiles> <add varybyquerystring="*" location="Any" duration="00:00:01" policy="CacheForTimePeriod" extension=".aspx"> </profiles> </add></caching> </system.webserver> </location> </configuration>
这篇关于如何在内存和磁盘上设置缓存限制的ASP文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文