{"id":26990440,"url":"https://github.com/fdesjardins/proxycache","last_synced_at":"2025-08-22T00:37:00.866Z","repository":{"id":57155780,"uuid":"66819860","full_name":"fdesjardins/proxycache","owner":"fdesjardins","description":"Web proxy caching for Node [Not Maintained]","archived":false,"fork":false,"pushed_at":"2018-01-06T06:25:41.000Z","size":155,"stargazers_count":2,"open_issues_count":7,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-09T01:04:54.086Z","etag":null,"topics":["cache","file-cache","google-cloud","google-cloud-storage","nodejs","proxy","proxy-cache","proxycache"],"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/fdesjardins.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}},"created_at":"2016-08-29T07:02:54.000Z","updated_at":"2019-01-17T08:22:35.000Z","dependencies_parsed_at":"2022-08-26T09:31:29.346Z","dependency_job_id":null,"html_url":"https://github.com/fdesjardins/proxycache","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdesjardins%2Fproxycache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdesjardins%2Fproxycache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdesjardins%2Fproxycache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdesjardins%2Fproxycache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fdesjardins","download_url":"https://codeload.github.com/fdesjardins/proxycache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247085972,"owners_count":20881157,"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":["cache","file-cache","google-cloud","google-cloud-storage","nodejs","proxy","proxy-cache","proxycache"],"created_at":"2025-04-03T21:38:05.637Z","updated_at":"2025-04-03T21:38:06.213Z","avatar_url":"https://github.com/fdesjardins.png","language":"JavaScript","readme":"# proxycache\n\n[![Build Status](https://travis-ci.org/fdesjardins/proxycache.svg?branch=master)](https://travis-ci.org/fdesjardins/proxycache)\n[![NPM Version](http://img.shields.io/npm/v/proxycache.svg?style=flat)](https://www.npmjs.org/package/proxycache)\n[![Coverage Status](https://coveralls.io/repos/github/fdesjardins/proxycache/badge.svg?branch=master)](https://coveralls.io/github/fdesjardins/proxycache?branch=master)\n\nA simple, configurable, Redis-powered caching proxy.\n\nUse it when you want to\n- deliver a URL to a static file\n- cache the file somewhere\n- provide a URL to the cached version for subsequent requests\n\n# Install\n\n```\n$ npm install --save proxycache\n```\n\n# Example\n\n```javascript\nconst express = require('express')\nconst request = require('request')\nconst proxycache = require('proxycache')\n\n// Create Redis/Cloud Storage proxycache client\nconst config = {\n  store: {\n    client: 'redis',\n    connection: {}\n  },\n  cache: {\n    client: 'gcloud',\n    connection: {\n      keyFilename: './gcloud-key.json',\n      projectId: 'my-project-id'\n    },\n    options: {\n      bucket: 'images'\n    }\n  }\n}\nlet cache\nproxycache(config).then(client =\u003e {\n  cache = client\n})\n\n// Image server to proxy for\nconst imgsrv = express()\nimgsrv.get('/images/:id', (req, res) =\u003e {\n  const id = req.params.id\n  request.get(`http://www.fillmurray.com/g/${id}/${id}`).pipe(res)\n})\nimgsrv.listen(3888)\nconsole.log('Image server listening on 3888')\n\nconst render = src =\u003e `\n\u003chtml\u003e\n  \u003chead\u003e\n   \u003ctitle\u003ebfm\u003c/title\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n   \u003cimg src='${src}' height=500 width=500/\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n`\n\n// API Server\nconst app = express()\napp.get('/images/:id', (req, res) =\u003e {\n  const id = req.params.id\n  // query the cache\n  cache.get(id).then(result =\u003e {\n   // cache hit\n    if (result) {\n      return res.end(render(result))\n    }\n    const uri = `http://localhost:3888/images/${id}`\n   // cache miss; send the default url\n    res.end(render(uri))\n   // cache the file; TTL in seconds\n    cache.set(id, uri, 60)\n  })\n})\napp.listen(8000)\n```\n\n## API\n\n### proxycache(options)\n\n#### options\n\n#####\n\nType: `object`\n\n# License\n\nMIT © [Forrest Desjardins](https://github.com/fdesjardins)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffdesjardins%2Fproxycache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffdesjardins%2Fproxycache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffdesjardins%2Fproxycache/lists"}