{"id":23086864,"url":"https://github.com/pin3appl3ishan/caching_proxy","last_synced_at":"2026-01-12T07:28:25.362Z","repository":{"id":263008938,"uuid":"889057005","full_name":"Pin3appl3ishan/caching_proxy","owner":"Pin3appl3ishan","description":"A Spring Boot CLI tool that starts a caching proxy server to forward requests to an origin server and cache responses. If the same request is made again, the cached response is returned instead of contacting the origin.","archived":false,"fork":false,"pushed_at":"2025-08-12T04:27:52.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-12T05:38:16.105Z","etag":null,"topics":["backend","cli","java","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","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/Pin3appl3ishan.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,"zenodo":null}},"created_at":"2024-11-15T14:25:39.000Z","updated_at":"2025-08-12T04:27:54.000Z","dependencies_parsed_at":"2024-11-15T15:41:22.900Z","dependency_job_id":"06052dd7-0a2b-4bce-b68b-8557099cb79f","html_url":"https://github.com/Pin3appl3ishan/caching_proxy","commit_stats":null,"previous_names":["pin3appl3ishan/caching_proxy"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Pin3appl3ishan/caching_proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pin3appl3ishan%2Fcaching_proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pin3appl3ishan%2Fcaching_proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pin3appl3ishan%2Fcaching_proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pin3appl3ishan%2Fcaching_proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pin3appl3ishan","download_url":"https://codeload.github.com/Pin3appl3ishan/caching_proxy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pin3appl3ishan%2Fcaching_proxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28336514,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T06:09:07.588Z","status":"ssl_error","status_checked_at":"2026-01-12T06:05:18.301Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["backend","cli","java","spring-boot"],"created_at":"2024-12-16T19:31:54.837Z","updated_at":"2026-01-12T07:28:25.357Z","avatar_url":"https://github.com/Pin3appl3ishan.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🗄️ Caching Proxy Server (Spring Boot CLI)\n\nA **Spring Boot** CLI tool that starts a caching proxy server to forward requests to an origin server and cache responses.  \nIf the same request is made again, the cached response is returned instead of contacting the origin.\n\n---\n\n## 🚀 Features\n- **Forward requests** to an origin server.\n- **In-memory response caching** with `X-Cache` header:\n  - `HIT` → served from cache.\n  - `MISS` → fetched from origin.\n- **Configurable port \u0026 origin** via CLI args.\n- **Clear cache** via CLI flag.\n\n---\n\n## 🛠 Usage\n\n### Start the proxy server\n```bash\njava -jar caching-proxy.jar --port=\u003cnumber\u003e --origin=\u003curl\u003e\n````\n\nExample:\n\n```bash\njava -jar caching-proxy.jar --port=3000 --origin=http://dummyjson.com\n```\n\nNow:\n\n```\nhttp://localhost:3000/products → forwarded to http://dummyjson.com/products\n```\n\n### Clear the cache\n\n```bash\njava -jar caching-proxy.jar --clear-cache\n```\n\n---\n\n## 📂 How It Works\n\n1. **Startup**: Parses CLI args for `port` and `origin`, starts an embedded Tomcat server.\n2. **On Request**:\n\n   * Checks cache for the request path.\n   * If cached → return with `X-Cache: HIT`.\n   * If not cached → fetch from origin, store, return with `X-Cache: MISS`.\n3. **Cache Clearing**: `--clear-cache` flag empties in-memory store.\n\n---\n\n## 🏗 Tech Stack\n\n* **Java 17+**\n* **Spring Boot**\n* **RestTemplate** / **WebClient** for forwarding\n* **ConcurrentHashMap** for in-memory caching\n\n---\n\n## 📌 Example Flow\n\n1. First request: `/products` → MISS (stored in cache).\n2. Next request: `/products` → HIT (served from cache).\n\n---\n\n📌 Project idea from: [roadmap.sh/projects/caching-server](https://roadmap.sh/projects/caching-server)\n\n\n## 📜 License\n\nMIT License\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpin3appl3ishan%2Fcaching_proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpin3appl3ishan%2Fcaching_proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpin3appl3ishan%2Fcaching_proxy/lists"}