{"id":21023048,"url":"https://github.com/tkssharma/pwa-workbox-react","last_synced_at":"2025-03-13T18:14:22.502Z","repository":{"id":151800481,"uuid":"204424359","full_name":"tkssharma/pwa-workbox-react","owner":"tkssharma","description":"React PWA Workbox ","archived":false,"fork":false,"pushed_at":"2019-08-26T11:17:16.000Z","size":203,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-20T13:34:34.236Z","etag":null,"topics":["pwa","reactjs","workbox"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tkssharma.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-08-26T07:51:24.000Z","updated_at":"2020-08-10T12:49:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"be1e6b44-654d-40ad-90f1-bc895c16aadd","html_url":"https://github.com/tkssharma/pwa-workbox-react","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkssharma%2Fpwa-workbox-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkssharma%2Fpwa-workbox-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkssharma%2Fpwa-workbox-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkssharma%2Fpwa-workbox-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tkssharma","download_url":"https://codeload.github.com/tkssharma/pwa-workbox-react/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243456567,"owners_count":20293904,"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":["pwa","reactjs","workbox"],"created_at":"2024-11-19T11:16:42.342Z","updated_at":"2025-03-13T18:14:22.487Z","avatar_url":"https://github.com/tkssharma.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Using Workbox with Create React App\n\nEmployee CRUD with WorkBox \n\n### Build the project\n\n```bash\n$ npm install\n$ npm run build\n```\n### Running  Application\n\n```bash\n$ yarn global add serve\n$ serve -s build\nor \n$ cd build\n$ python -m SimpleHTTPServer 8000\n```\n### caching mechanism using workbox\n\n```\nworkbox.routing.registerRoute(\n  new RegExp('.css$'),\n  workbox.strategies.cacheFirst({\n    cacheName: 'poc-cache-Stylesheets',\n    plugins: [\n      new workbox.expiration.Plugin({\n        maxAgeSeconds: 60 * 60 * 24 * 7, // cache for one week\n        maxEntries: 20, // only cache 20 request\n        purgeOnQuotaError: true,\n      }),\n    ],\n  }),\n);\nworkbox.routing.registerRoute(\n  new RegExp('.(png|svg|jpg|jpeg)$'),\n  workbox.strategies.cacheFirst({\n    cacheName: 'poc-cache-Images',\n    plugins: [\n      new workbox.expiration.Plugin({\n        maxAgeSeconds: 60 * 60 * 24 * 7,\n        maxEntries: 50,\n        purgeOnQuotaError: true,\n      }),\n    ],\n  }),\n);\n\nworkbox.routing.registerRoute(\n  new RegExp('https://randomuser.me/api/'),\n  workbox.strategies.staleWhileRevalidate({\n    cacheName: 'poc-cache-employees',\n    cacheExpiration: {\n      maxAgeSeconds: 60 * 30,\n    },\n  }),\n);\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftkssharma%2Fpwa-workbox-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftkssharma%2Fpwa-workbox-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftkssharma%2Fpwa-workbox-react/lists"}