Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Caching Proxy Server

This is a simple caching proxy server written in Go. It forwards requests to an origin server, caches the responses, and serves cached responses for subsequent requests.

Features

  • Forwards requests to an origin server
  • Caches responses to reduce load on the origin server
  • Serves cached responses for subsequent requests
  • Provides an option to clear the cache

Usage

Running the Server

To run the caching proxy server, use the following command:

go run main.go --origin <origin_url> --port <port>
  • --origin: The URL of the origin server to forward requests to (required).
  • --port: The port to run the caching proxy server on (default: 3000).

Example:

go run main.go --origin http://example.com --port 3000

Clearing the Cache

To clear the cache, use the --clear-cache flag:

go run main.go --clear-cache

Code Overview

The main components of the caching proxy server are:

  • ProxyHandler: Forwards requests to the origin server and caches responses.
  • ClearCache: Clears the cached data.
  • main: Parses command-line flags and starts the server.

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages