访问别人的网站,如果已经访问过一次了,js就会被缓存,下次访问就不下载,但为什么我的就每次下载呢?该怎么处理?
我用的vs2005开发的asp.net网站。

解决方案 »

  1.   

    非常感谢您的指导!请问具体怎么启动cache?我的web.config还需要什么设置?<?xml version="1.0"?>
    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    <configSections>
    <sectionGroup name="blowery.web">
    <section name="httpCompress" type="blowery.Web.HttpCompress.SectionHandler, blowery.Web.HttpCompress"/>
    </sectionGroup>
    <sectionGroup name="microsoft.web" type="Microsoft.Web.Configuration.MicrosoftWebSectionGroup">
    <section name="converters" type="Microsoft.Web.Configuration.ConvertersSection" requirePermission="false"/>
    <section name="webServices" type="Microsoft.Web.Configuration.WebServicesSection" requirePermission="false"/>
    <section name="authenticationService" type="Microsoft.Web.Configuration.AuthenticationServiceSection" requirePermission="false"/>
    <section name="profileService" type="Microsoft.Web.Configuration.ProfileServiceSection" requirePermission="false"/>
    </sectionGroup>
    </configSections>
    <blowery.web>
    <httpCompress preferredAlgorithm="gzip" compressionLevel="high">
    <excludedMimeTypes>
    <add type="image/jpeg"/>
    <add type="image/gif"/>
    </excludedMimeTypes>
    <excludedPaths>
    <add path="WebResource.axd"/>
    </excludedPaths>
    </httpCompress>
    </blowery.web>
    <microsoft.web>
    <converters>
    <add type="Microsoft.Web.Script.Serialization.Converters.DataSetConverter"/>
    <add type="Microsoft.Web.Script.Serialization.Converters.DataRowConverter"/>
    <add type="Microsoft.Web.Script.Serialization.Converters.DataTableConverter"/>
    <add type="Jssor.JssorConverter, HRM.Common"/>
    </converters>
    <webServices enableBrowserAccess="true"/>
    </microsoft.web>
    <system.web>
    <httpHandlers>
    <remove verb="*" path="*.asmx"/>
    <add verb="*" path="*.asmx" type="Microsoft.Web.Services.ScriptHandlerFactory" validate="false"/>
    <add verb="*" path="atlasbatchcall.axd" type="Microsoft.Web.Services.MultiRequestHandler" validate="false"/>
    <add verb="*" path="atlasglob.axd" type="Microsoft.Web.Globalization.GlobalizationHandler" validate="false"/>
    <add verb="*" path="*.asbx" type="Microsoft.Web.Services.ScriptHandlerFactory" validate="false"/>
    </httpHandlers>
    <httpModules>
    <add name="ScriptModule" type="Microsoft.Web.Services.ScriptModule"/>
    <add name="BridgeModule" type="Microsoft.Web.Services.BridgeModule"/>
    <add name="WebResourceCompression" type="Microsoft.Web.Services.WebResourceCompressionModule"/>
    <add name="CompressionModule" type="blowery.Web.HttpCompress.HttpModule, blowery.web.HttpCompress"/>
    </httpModules>
    <pages enableEventValidation="false">
    <controls>
    <add namespace="Microsoft.Web.UI" assembly="Microsoft.Web.Atlas" tagPrefix="atlas"/>
    <add namespace="Microsoft.Web.UI.Controls" assembly="Microsoft.Web.Atlas" tagPrefix="atlas"/>
    </controls>
    </pages>
    <compilation defaultLanguage="c#" debug="true">
    <buildProviders>
    <add extension=".asbx" type="Microsoft.Web.Services.BridgeBuildProvider"/>
    </buildProviders>
    </compilation>
    <customErrors mode="Off"/>
    <authentication mode="Forms">
    <forms loginUrl="~/Login.aspx" timeout="1000"/>
    </authentication>
    <authorization>
    <allow users="?"/>
    </authorization>
    <trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true"/>
    <sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" cookieless="false" timeout="1000"/>
    <globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
    <webServices>
    <protocols>
    <add name="HttpPost"/>
    <!--add name="HttpGet" /-->
    </protocols>
    </webServices>
    </system.web>
    </configuration>
      

  2.   

    非常感谢您的指导!请问具体怎么启动cache?我的web.config还需要什么设置?<?xml version="1.0"?>
    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    <configSections>
    <sectionGroup name="blowery.web">
    <section name="httpCompress" type="blowery.Web.HttpCompress.SectionHandler, blowery.Web.HttpCompress"/>
    </sectionGroup>
    <sectionGroup name="microsoft.web" type="Microsoft.Web.Configuration.MicrosoftWebSectionGroup">
    <section name="converters" type="Microsoft.Web.Configuration.ConvertersSection" requirePermission="false"/>
    <section name="webServices" type="Microsoft.Web.Configuration.WebServicesSection" requirePermission="false"/>
    <section name="authenticationService" type="Microsoft.Web.Configuration.AuthenticationServiceSection" requirePermission="false"/>
    <section name="profileService" type="Microsoft.Web.Configuration.ProfileServiceSection" requirePermission="false"/>
    </sectionGroup>
    </configSections>
    <blowery.web>
    <httpCompress preferredAlgorithm="gzip" compressionLevel="high">
    <excludedMimeTypes>
    <add type="image/jpeg"/>
    <add type="image/gif"/>
    </excludedMimeTypes>
    <excludedPaths>
    <add path="WebResource.axd"/>
    </excludedPaths>
    </httpCompress>
    </blowery.web>
    <microsoft.web>
    <converters>
    <add type="Microsoft.Web.Script.Serialization.Converters.DataSetConverter"/>
    <add type="Microsoft.Web.Script.Serialization.Converters.DataRowConverter"/>
    <add type="Microsoft.Web.Script.Serialization.Converters.DataTableConverter"/>
    <add type="Jssor.JssorConverter, HRM.Common"/>
    </converters>
    <webServices enableBrowserAccess="true"/>
    </microsoft.web>
    <system.web>
    <httpHandlers>
    <remove verb="*" path="*.asmx"/>
    <add verb="*" path="*.asmx" type="Microsoft.Web.Services.ScriptHandlerFactory" validate="false"/>
    <add verb="*" path="atlasbatchcall.axd" type="Microsoft.Web.Services.MultiRequestHandler" validate="false"/>
    <add verb="*" path="atlasglob.axd" type="Microsoft.Web.Globalization.GlobalizationHandler" validate="false"/>
    <add verb="*" path="*.asbx" type="Microsoft.Web.Services.ScriptHandlerFactory" validate="false"/>
    </httpHandlers>
    <httpModules>
    <add name="ScriptModule" type="Microsoft.Web.Services.ScriptModule"/>
    <add name="BridgeModule" type="Microsoft.Web.Services.BridgeModule"/>
    <add name="WebResourceCompression" type="Microsoft.Web.Services.WebResourceCompressionModule"/>
    <add name="CompressionModule" type="blowery.Web.HttpCompress.HttpModule, blowery.web.HttpCompress"/>
    </httpModules>
    <pages enableEventValidation="false">
    <controls>
    <add namespace="Microsoft.Web.UI" assembly="Microsoft.Web.Atlas" tagPrefix="atlas"/>
    <add namespace="Microsoft.Web.UI.Controls" assembly="Microsoft.Web.Atlas" tagPrefix="atlas"/>
    </controls>
    </pages>
    <compilation defaultLanguage="c#" debug="true">
    <buildProviders>
    <add extension=".asbx" type="Microsoft.Web.Services.BridgeBuildProvider"/>
    </buildProviders>
    </compilation>
    <customErrors mode="Off"/>
    <authentication mode="Forms">
    <forms loginUrl="~/Login.aspx" timeout="1000"/>
    </authentication>
    <authorization>
    <allow users="?"/>
    </authorization>
    <trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true"/>
    <sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" cookieless="false" timeout="1000"/>
    <globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
    <webServices>
    <protocols>
    <add name="HttpPost"/>
    <!--add name="HttpGet" /-->
    </protocols>
    </webServices>
    </system.web>
    </configuration>
      

  3.   

    非常感谢您的指导!请问具体怎么启动cache?我的web.config还需要什么设置?<?xml version="1.0"?>
    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    <configSections>
    <sectionGroup name="blowery.web">
    <section name="httpCompress" type="blowery.Web.HttpCompress.SectionHandler, blowery.Web.HttpCompress"/>
    </sectionGroup>
    <sectionGroup name="microsoft.web" type="Microsoft.Web.Configuration.MicrosoftWebSectionGroup">
    <section name="converters" type="Microsoft.Web.Configuration.ConvertersSection" requirePermission="false"/>
    <section name="webServices" type="Microsoft.Web.Configuration.WebServicesSection" requirePermission="false"/>
    <section name="authenticationService" type="Microsoft.Web.Configuration.AuthenticationServiceSection" requirePermission="false"/>
    <section name="profileService" type="Microsoft.Web.Configuration.ProfileServiceSection" requirePermission="false"/>
    </sectionGroup>
    </configSections>
    <blowery.web>
    <httpCompress preferredAlgorithm="gzip" compressionLevel="high">
    <excludedMimeTypes>
    <add type="image/jpeg"/>
    <add type="image/gif"/>
    </excludedMimeTypes>
    <excludedPaths>
    <add path="WebResource.axd"/>
    </excludedPaths>
    </httpCompress>
    </blowery.web>
    <microsoft.web>
    <converters>
    <add type="Microsoft.Web.Script.Serialization.Converters.DataSetConverter"/>
    <add type="Microsoft.Web.Script.Serialization.Converters.DataRowConverter"/>
    <add type="Microsoft.Web.Script.Serialization.Converters.DataTableConverter"/>
    <add type="Jssor.JssorConverter, HRM.Common"/>
    </converters>
    <webServices enableBrowserAccess="true"/>
    </microsoft.web>
    <system.web>
    <httpHandlers>
    <remove verb="*" path="*.asmx"/>
    <add verb="*" path="*.asmx" type="Microsoft.Web.Services.ScriptHandlerFactory" validate="false"/>
    <add verb="*" path="atlasbatchcall.axd" type="Microsoft.Web.Services.MultiRequestHandler" validate="false"/>
    <add verb="*" path="atlasglob.axd" type="Microsoft.Web.Globalization.GlobalizationHandler" validate="false"/>
    <add verb="*" path="*.asbx" type="Microsoft.Web.Services.ScriptHandlerFactory" validate="false"/>
    </httpHandlers>
    <httpModules>
    <add name="ScriptModule" type="Microsoft.Web.Services.ScriptModule"/>
    <add name="BridgeModule" type="Microsoft.Web.Services.BridgeModule"/>
    <add name="WebResourceCompression" type="Microsoft.Web.Services.WebResourceCompressionModule"/>
    <add name="CompressionModule" type="blowery.Web.HttpCompress.HttpModule, blowery.web.HttpCompress"/>
    </httpModules>
    <pages enableEventValidation="false">
    <controls>
    <add namespace="Microsoft.Web.UI" assembly="Microsoft.Web.Atlas" tagPrefix="atlas"/>
    <add namespace="Microsoft.Web.UI.Controls" assembly="Microsoft.Web.Atlas" tagPrefix="atlas"/>
    </controls>
    </pages>
    <compilation defaultLanguage="c#" debug="true">
    <buildProviders>
    <add extension=".asbx" type="Microsoft.Web.Services.BridgeBuildProvider"/>
    </buildProviders>
    </compilation>
    <customErrors mode="Off"/>
    <authentication mode="Forms">
    <forms loginUrl="~/Login.aspx" timeout="1000"/>
    </authentication>
    <authorization>
    <allow users="?"/>
    </authorization>
    <trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true"/>
    <sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" cookieless="false" timeout="1000"/>
    <globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
    <webServices>
    <protocols>
    <add name="HttpPost"/>
    <!--add name="HttpGet" /-->
    </protocols>
    </webServices>
    </system.web>
    </configuration>