这个解决办法比较多,但先要明确一点的是网页是由哪种开发语言的。以下拿asp.net开发的微信web作案例讲解如何缓存它。
一般比较常见的方法是使用页面指令:OutputCache,格式比较繁锁:
<%@ OutputCache CacheProfile=" " NoStore="True | False" Duration="#ofseconds" Shared="True | False" Location="Any | Client | Downstream | Server | None | ServerandClient " SqlDependency="database/table name pair | CommandNotification "VaryByControl="controlname" VaryByCustom="browser | customstring" VaryByHeader="headers" VaryByParam="parametername" %>
使用举例:<%@ OutputCache Duration="600" VaryByParam="none"%>,表示页面输出缓存的有效期是10分钟