{"id":17362378,"url":"https://github.com/isocroft/cachr","last_synced_at":"2025-03-27T17:28:35.691Z","repository":{"id":73653665,"uuid":"76736930","full_name":"isocroft/Cachr","owner":"isocroft","description":"this is a library that makes it easy to use application cache in web browsers","archived":false,"fork":false,"pushed_at":"2020-03-06T13:48:08.000Z","size":15,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T20:44:57.319Z","etag":null,"topics":["appcache","fallback","javascript","offline","pwa"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/isocroft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-17T17:17:18.000Z","updated_at":"2020-03-06T13:48:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"4383450d-1e27-486f-b61c-1a76a5dd55f6","html_url":"https://github.com/isocroft/Cachr","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isocroft%2FCachr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isocroft%2FCachr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isocroft%2FCachr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isocroft%2FCachr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isocroft","download_url":"https://codeload.github.com/isocroft/Cachr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245891764,"owners_count":20689393,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["appcache","fallback","javascript","offline","pwa"],"created_at":"2024-10-15T19:38:03.398Z","updated_at":"2025-03-27T17:28:35.682Z","avatar_url":"https://github.com/isocroft.png","language":"JavaScript","readme":"# Cachr\r\n\r\nThis is a very small library that serves to provide a fallback to **Service Workers** in browser where support is absent. **Application Cache** has relatively good browser support and is well suited for a _service worker fallback_. For iOS support see this [docs link on offline storage on the iPhone](https://developer.apple.com/library/archive/documentation/iPhone/Conceptual/SafariJSDatabaseGuide/OfflineApplicationCache/OfflineApplicationCache.html)\r\n\r\nIt simply implements Application Cache with an easy interface.\r\n\r\n## Support\r\n- Internet Explorer 10+\r\n- Safari 4+\r\n- Firefox 3.5+\r\n- Opera 11.6+\r\n- Chrome 4+\r\n\r\n## Setting up (How to)\r\n\r\n- [Create an \u003cb\u003e\u003ci\u003e.appcache\u003c/i\u003e\u003c/b\u003e file](https://www.sitepoint.com/creating-offline-html5-apps-with-appcache/) with the name \u003cq\u003emanifest\u003c/q\u003e in the root folder of your web project.\r\n- Copy in the \u003ci\u003e\u003cq\u003eoffline.html\u003c/q\u003e\u003c/i\u003e file into the root folder of your web project.\r\n- Create your application index file and link it to _Cachr_ using a script tag.\r\n- Use the script shown below to activate Cachr\r\n- Beware of [these pitfalls](https://www.sitepoint.com/common-pitfalls-avoid-using-html5-application-cache/) as you use _applicationCache_ and _Cachr_\r\n\r\n```js\r\n\t\u003cscript type=\"text/javascript\"\u003e\r\n\t\t!function(win){\r\n\t\t\t'use strict';\r\n\r\n\t\t\tif(win.applicationCache \u0026\u0026 win.Cachr){\r\n\t\t\t\twin.Cachr.go();\r\n\t\t\t}\r\n\t\t}(this);\r\n\t\u003c/script\u003e\r\n```\r\n\r\nAnd that's all to it.\r\n\r\n## Important Info\r\n\r\n\u003eThe _manifest.appcache_ file must be in the root of your application as well as the _offline.html_ file. By extension, this means that both files must be in the same domain so as to avoid Same-Origin Policy restrictions by the browser. Also, you have to configure the server to serve the _manifest.appcache_ file with the correct mime type and force the browser never to cache it (preferrably using a .htaccess file). _Please see the \u003cb\u003eexamples\u003c/b\u003e folder for more insight_\r\n\r\n## Caveats/Gotchas\r\n\r\n\u003eIf any of the files listed in the _manifest.appcache_ file is modified, the _manifest.appcache_ file itself must also be modified. You can do this by altering the date comment on the second line using a _server script_ or a _schedule script_ perhaps so you don't have to do it manually yourself everytime.\r\n\r\n## Licence\r\n\r\nMIT license\r\n\r\n## Issues/Bugs\r\n\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisocroft%2Fcachr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisocroft%2Fcachr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisocroft%2Fcachr/lists"}