HTML 5 - Testing Offline Cache with localhost

不打扰是莪最后的温柔 提交于 2019-12-05 18:14:51

staticDate.html is served by Tomcat as well. So you need to keep Tomcat running, but after the browser has cached the website, disable the servlet for date.jsp.

You're doing it wrong. HTML5 offline is for when your internet connection is down, not when the server is down. If you have an internet connection on your computer, then it will try to hit the server, find out Tomcat isn't running, and return a 404 or 503 error.

If your computer's internet connection is down, then the browser should recognize that you have no internet connectivity and then attempt the fallback.

This also assumes you've coded everything correctly and are using an HTML5 browser.

To test, I would suggest disabling your PC/Mac's internet connection.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!