Skip to content

CrimsonKarma44/caching-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Caching Proxy


Cache Proxy is a simple, bare-bones caching proxy server implemented in Go. It serves as a basic solution for caching HTTP requests and responses, using an on-disk storage to store the cache.

Features


  • On-disk Caching:

    • The server uses on-disk to store cached responses. This approach allows data stored on disk persists across application restarts and crashes. This ensures that cached data remains available for subsequent requests, reducing the need to recompute or re-fetch data.
  • Proxy Functionality:

    • The server forwards client requests to the target server and caches the responses. If the same request is made again, the server returns the cached response, saving the time and resources of making a new request to the target server.

Usage


Start the server:

go run cmd/proxy/main.go --port <PORT> --origin <ORIGIN_URL>

Note: the order of port and origin does not matter

To clear the cache::

go run cmd/proxy/main.go --clear-cache

Limitations


No Cache Eviction Policy:

  • This implementation does not include a cache eviction policy. The cache will grow indefinitely, which could lead to memory exhaustion in long-running scenarios. Adding an eviction policy like LRU (Least Recently Used) would be a recommended enhancement.

Extras


This Repo serves as a solution to Roadmap.sh Caching Server Problem

About

A caching proxy server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages