After looking at the static page conversion platform (STATICPOL)-static page Generation Ultimate solution, I have done this thing I put up now, is also turned into static pages, limited to dotnet use (I was treated with HttpHandler), and also very simple, mainly to achieve the function I want, The shortfall is certainly a lot of (I will mention two points later), I hope not to delay your time.
Here's a concrete implementation:
The configuration in the 1.web.config
<!--configuration policy config file address-->
<appSettings>
<add key= "ConfigFilePath" value= "Config/statictactic.config"/>
</ Appsettings> ...
(omitted)
<!--configuration httphandler-->
2. Policy configuration file
<!--
Rules.root: Generated static pages in the Web site root directory folder
Rules.timespan: Default Expiration Time difference (in minutes)
LookFor: Pages that need to generate static pages
TimeSpan: The Expiration time difference for static pages (in minutes)
-->
<StaticTacConfig>
<rules root= "HTML" timespan= "> <tacrule lookfor=
" Default.aspx ">
<TimeSpan>1</TimeSpan>
</TacRule>
<tacrule lookfor=" product/ Sort.aspx ">
<TimeSpan>10</TimeSpan>
</TacRule>
</Rules>
</ Statictacconfig>
3.HttpHandler implementation of this relatively simple, we look at the source code will know. The main is to determine whether the requested page needs to generate static pages, if necessary, to determine whether the static page exists or exists but has expired does not exist, or exist but the outdated pages need to be regenerated.
This article supporting source code