{"id":16398905,"url":"https://github.com/albertyw/ajax-cache-parser","last_synced_at":"2025-03-23T05:31:03.051Z","repository":{"id":1917824,"uuid":"45324714","full_name":"albertyw/ajax-cache-parser","owner":"albertyw","description":"A small function to calculate when an ajax request expires","archived":false,"fork":false,"pushed_at":"2024-12-23T18:28:32.000Z","size":271,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T18:01:26.231Z","etag":null,"topics":["browser","cache","javascript"],"latest_commit_sha":null,"homepage":"","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/albertyw.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2015-11-01T01:45:20.000Z","updated_at":"2024-12-23T18:28:29.000Z","dependencies_parsed_at":"2024-04-21T20:06:40.895Z","dependency_job_id":"30dfdf3b-2f08-49a4-b1bf-68a555540a2e","html_url":"https://github.com/albertyw/ajax-cache-parser","commit_stats":{"total_commits":69,"total_committers":4,"mean_commits":17.25,"dds":"0.49275362318840576","last_synced_commit":"83faa503dddfb281881f4e5ddf7cd4dd2b92db0e"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albertyw%2Fajax-cache-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albertyw%2Fajax-cache-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albertyw%2Fajax-cache-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albertyw%2Fajax-cache-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/albertyw","download_url":"https://codeload.github.com/albertyw/ajax-cache-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245061382,"owners_count":20554563,"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":["browser","cache","javascript"],"created_at":"2024-10-11T05:14:15.686Z","updated_at":"2025-03-23T05:31:02.653Z","avatar_url":"https://github.com/albertyw.png","language":"JavaScript","readme":"ajax-cache-parser\n=================\n\n[![NPM](https://nodei.co/npm/ajax-cache-parser.png?downloads=true\u0026downloadRank=true)](https://nodei.co/npm/ajax-cache-parser/)\n\n[![Build Status](https://drone.albertyw.com/api/badges/albertyw/ajax-cache-parser/status.svg)](https://drone.albertyw.com/albertyw/ajax-cache-parser)\n[![Code Climate](https://codeclimate.com/github/albertyw/ajax-cache-parser/badges/gpa.svg)](https://codeclimate.com/github/albertyw/ajax-cache-parser)\n[![Test Coverage](https://codeclimate.com/github/albertyw/ajax-cache-parser/badges/coverage.svg)](https://codeclimate.com/github/albertyw/ajax-cache-parser/coverage)\n[![install size](https://packagephobia.com/badge?p=ajax-cache-parser)](https://packagephobia.com/result?p=ajax-cache-parser)\n\nA small function to get when an ajax request expires\n\nGiven an XMLHttpRequest object that has received response headers back from a server, `getCacheExpiry` will return\na javascript `Date` object that represents when the response will expire based on the `Expires` and `Cache-Control`\nresponse headers.  If caching headers are not present or are unparseable, `undefined` will be returned.  If caching\nheaders indicate that the resource should not be cached, `null` will be returned.\n\nExample\n-------\n```javascript\nfunction callback(){\n  var expiration = parser.getCacheExpiry(this);\n  // do something with expiration\n}\nvar oReq = new XMLHttpRequest();\noReq.onload = callback;\noReq.open(\"get\", yourUrl, true);\noReq.send();\n```\n\nInformation about caching headers comes from: https://www.mnot.net/cache_docs/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbertyw%2Fajax-cache-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falbertyw%2Fajax-cache-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbertyw%2Fajax-cache-parser/lists"}