kratgo

Simple, lightweight and ultra-fast HTTP Cache to speed up your websites

Github星跟踪图

Kratgo

Build Status
Go Report Card
GitHub release
Docker

Simple, lightweight and ultra-fast HTTP Cache to speed up your websites.

Requirements

  • Go >= 1.11.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:

git clone https://github.com/savsgio/kratgo.git && cd kratgo

and execute:

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:

{
	"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

Get a basic configuration from here and customize it.

Run with:

docker run --rm --name kratgo -it -v <VOLUME WITH CONFIG> -p 6081:6081 -p 6082:6082 savsgio/kratgo -config <CONFIG FILE PATH IN THE VOLUME>

Developers

Copy configuration file ./config/kratgo.conf.yml to ./config/kratgo-dev.conf.yml, and customize it.

Run with:

make run

Contributing

Feel free to contribute it or fork me... :wink:

主要指标

概览
名称与所有者savsgio/kratgo
主编程语言Go
编程语言Dockerfile (语言数: 4)
平台
许可证GNU General Public License v3.0
所有者活动
创建于2019-02-04 11:30:28
推送于2023-03-17 16:08:26
最后一次提交2023-03-17 17:05:52
发布数13
最新版本名称v1.2.0 (发布于 )
第一版名称v1.0.0 (发布于 )
用户参与
星数65
关注者数5
派生数8
提交数142
已启用问题?
问题数0
打开的问题数0
拉请求数3
打开的拉请求数0
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?