404 Error When Caching .aspx Pages With HTML5 Cach

2019-06-09 04:02发布

Has anyone been able to cache .aspx pages using the HTML cache manifest? I am porting an html application over to asp.net (and mvc2) and I get a 404 error when trying to cache any *.aspx page. Other files still cache normally (.js, .css, etc). I have changed permissions, handlers, and file names and still no luck. Below is the actual manifest:

CACHE MANIFEST
# This file was generated at 2/28/2011 4:03 PM
CACHE:
/Content/Site.css
/Content/Table_style.css
/Scripts/jquery-1.5.min.js
/Scripts/json.js
/Scripts/persist-all.js
/Views/Data/Details.aspx
/Views/Data/NotFound.aspx
/Views/Data/OffLine.aspx
/Views/Data/OnLine.aspx
/Views/Data/Test.aspx
/Views/Home/About.aspx
/Views/Home/Index.aspx
/Views/Shared/Error.aspx

1条回答
叼着烟拽天下
2楼-- · 2019-06-09 04:48

Every request goes through a controller, not directly to the view. Look at the url's in your browser, it never ends with .aspx (when using MVC).

It looks like you have a Data and a Home controller. Your urls will probably be something like:

  • /Data/Details
  • /Data/NotFound
  • /Data/OffLine
  • /Data/OnLine
  • /Data/Test
  • /About
  • /

These are the url's you need in your cache manifest.

查看更多
登录 后发表回答