Using Appcache with CodeIgniter

六眼飞鱼酱① 提交于 2019-12-04 12:00:43

You can make a Manifest controller with just an index() method, and make /index.php/manifest return the CACHE MANIFEST document (with appropriate headers).

And then include that on the page with

<html manifest="/myapp/index.php/manifest">

Additional notes:

  • app cache works with urls, not files — so it has no idea that index.php and index.php/index (etc) are "the same file".
  • if a html file includes a manifest, that file is cached automatically, so you don't have to explicitly include that in the CACHE: directive. (You only need to explicitly list additional css/js files, etc)
  • in the manifest, don't use the full URL (http://…), just the path itself (/myapp/index…).
  • I highly reccomend you go through the Application Cache documentation once again just to make sure you've understood everything correctly. It's a really tricky thing to get working correctly.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!