Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/savsgio/kratgo
Simple, lightweight and ultra-fast HTTP Cache to speed up your websites
https://github.com/savsgio/kratgo
caching fasthttp-cache high-performance http http-cache lightweight-cache
Last synced: 16 days ago
JSON representation
Simple, lightweight and ultra-fast HTTP Cache to speed up your websites
- Host: GitHub
- URL: https://github.com/savsgio/kratgo
- Owner: savsgio
- License: gpl-3.0
- Created: 2019-02-04T11:30:28.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-17T16:08:26.000Z (over 1 year ago)
- Last Synced: 2024-10-15T22:06:40.598Z (29 days ago)
- Topics: caching, fasthttp-cache, high-performance, http, http-cache, lightweight-cache
- Language: Go
- Homepage:
- Size: 229 KB
- Stars: 64
- Watchers: 6
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Kratgo
======[![Test status](https://github.com/savsgio/kratgo/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/savsgio/kratgo/actions?workflow=test)
[![Go Report Card](https://goreportcard.com/badge/github.com/savsgio/kratgo)](https://goreportcard.com/report/github.com/savsgio/kratgo)
[![GitHub release](https://img.shields.io/github/release/savsgio/kratgo.svg)](https://github.com/savsgio/kratgo/releases)
[![Docker](https://img.shields.io/docker/automated/savsgio/kratgo.svg?colorB=blue&style=flat)](https://hub.docker.com/r/savsgio/kratgo)Simple, lightweight and ultra-fast HTTP Cache to speed up your websites.
### Requirements
- [Go](https://golang.org/dl/) >= 1.20.X
- make
- git## Features:
- Cache proxy.
- Load balancing beetwen backends.
- Cache invalidation via API (Admin).
- Configuration to non-cache certain requests.
- Configuration to set or unset headers on especific requests.## General
To known if request pass across Kratgo Cache in backend servers, check the request header `X-Kratgo-Cache` with value `true`.
## Install
Clone the repository:
```bash
git clone https://github.com/savsgio/kratgo.git && cd kratgo
```and execute:
```bash
make
make install
```The binary file will install in `/usr/local/bin/kratgo` and configuration file in `/etc/kratgo/kratgo.conf.yml`
## Cache invalidation (Admin)
The cache invalidation is available via API. The API's address is configured in ***admin*** section of the configuration file.
This API only accepts ***POST*** requests with ***json***, under the path `/invalidate/`.
Ex: `http://localhost:6082/invalidate/`
The complete json body must be as following example:
```json
{
"host": "www.example.com",
"path": "/es/",
"header": {
"key": "Content-Type",
"value": "text/plain; charset=utf-8"
}
}
```**IMPORTANT: All fields are optional, but at least you must specify one.**
All invalidations will process by workers in Kratgo. You can configure the maximum available workers in the configuration.
The workers are activated only when necessary.
## Docker
The docker image is available in Docker Hub: [savsgio/kratgo](https://hub.docker.com/r/savsgio/kratgo)
Get a basic configuration from [here](https://github.com/savsgio/kratgo/blob/master/config/kratgo.conf.yml) and customize it.
Run with:
```bash
docker run --rm --name kratgo -it -v -p 6081:6081 -p 6082:6082 savsgio/kratgo -config
```## Developers
Copy configuration file `./config/kratgo.conf.yml` to `./config/kratgo-dev.conf.yml`, and customize it.
Run with:
```bash
make run
```Contributing
------------**Feel free to contribute it or fork me...** :wink: