{"id":24996858,"url":"https://github.com/elliot40404/icache","last_synced_at":"2026-04-25T22:31:39.131Z","repository":{"id":219501060,"uuid":"749201825","full_name":"elliot40404/icache","owner":"elliot40404","description":"experimental inmemory image cache and resize","archived":false,"fork":false,"pushed_at":"2024-01-30T08:41:39.000Z","size":2335,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-11T23:25:52.437Z","etag":null,"topics":["cache","docker","go","golang","image-processing","tools"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elliot40404.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-01-27T21:35:18.000Z","updated_at":"2024-01-29T21:10:46.000Z","dependencies_parsed_at":"2024-01-27T23:19:17.837Z","dependency_job_id":"f671e6b8-b420-4e77-a2c4-ecf9c7e74df1","html_url":"https://github.com/elliot40404/icache","commit_stats":null,"previous_names":["elliot40404/icache"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/elliot40404/icache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliot40404%2Ficache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliot40404%2Ficache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliot40404%2Ficache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliot40404%2Ficache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elliot40404","download_url":"https://codeload.github.com/elliot40404/icache/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliot40404%2Ficache/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32279652,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T18:29:39.964Z","status":"ssl_error","status_checked_at":"2026-04-25T18:29:32.149Z","response_time":59,"last_error":"SSL_read: 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":["cache","docker","go","golang","image-processing","tools"],"created_at":"2025-02-04T16:34:18.878Z","updated_at":"2026-04-25T22:31:39.126Z","avatar_url":"https://github.com/elliot40404.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ICACHE\n\nA simple golang server for dynamic caching of images from external sources in-memory.\n\n## Features\n\n-   [x] Caching of images from external sources in-memory\n-   [x] Dynamic resizing of images\n-   [x] Support for multiple image formats\n-   [x] Support for converting images to webp format\n-   [x] On-the-fly resizing of images without ever storing them on disk\n\n## Usage\n\n### Method 1\n\n1. Clone the repository and `cd` into it\n1. Run `make build` or `go build -o bin/icache cmd/api/main.go`\n1. Run `./bin/icache`\n\n### Method 2 [Recommended]\n\n1. Clone the repository and `cd` into it\n1. Run `docker build -t icache .`\n1. Run `docker run --rm -d --name icache -e PORT=8080 -p 8080:8080 icache`\n1. or just run `docker compose up -d`\n\n## API\n\n### GET /api/v1/image?url={url}\u0026width={width}\u0026height={height}\u0026format={format}\u0026resize={resize}\u0026bypass={bypass}\n\nDescription: Returns a resized image from the cache or from the external source if not found in the cache.\n\n```sh\ncurl --request GET \\\n  --url 'http://localhost:8080/api/v1/image?url=https%3A%2F%2Fpicsum.photos%2F3000%2F2000' \\\n  --header 'Accept-Encoding: gzip, compress, br'\n```\n\n#### Query Parameters\n\n| Parameter | Type   | Description                                 | Default |\n| :-------- | :----- | :------------------------------------------ | :------ |\n| url       | string | The url of the image to be cached           | \\*      |\n| width     | int    | The width of the image to be resized to     | #       |\n| height    | int    | The height of the image to be resized to    | #       |\n| webp      | bool   | Whether to convert the image to webp or not | false   |\n| resize    | bool   | Whether to resize the image or not          | true    |\n| bypass    | bool   | Whether to bypass the cache or not          | false   |\n\n**Note**\n`*` - Required\n`#` - Configurable via environment variables\n\nMake sure to encode the url parameter.\n\n### GET /api/v1/images\n\nDescription: Returns a list of all the images in the cache.\n\n```sh\ncurl --request GET \\\n  --url 'http://localhost:8080/api/v1/images'\n```\n\n### DELETE /api/v1/image\n\nDescription: Deletes an image from the cache.\n\n```sh\ncurl --request DELETE \\\n  --url 'http://localhost:8080/api/v1/image?url=https%3A%2F%2Fpicsum.photos%2F3000%2F2000'\n```\n\n#### Query Parameters\n\n| Parameter | Type   | Description                                   | Default |\n| :-------- | :----- | :-------------------------------------------- | :------ |\n| url       | string | The url of the image to be deleted from cache | \\*      |\n\n**Note**\n`*` - Required\n\nMake sure to encode the url parameter.\n\n### DELETE /api/v1/images\n\nDescription: Deletes all the images from the cache.\n\n```sh\ncurl --request DELETE \\\n  --url 'http://localhost:8080/api/v1/images'\n```\n\n## Environment Variables\n\n| Variable | Description                                                                  | Default |\n| :------- | :--------------------------------------------------------------------------- | :------ |\n| PORT     | The port on which the server will run                                        | 8080    |\n| ADDR     | The address on which the server will run                                     | 0.0.0.0 |\n| WIDTH    | The default width of the image to be resized to if not specified in request  | 400     |\n| HEIGHT   | The default height of the image to be resized to if not specified in request | 400     |\n\n**Note**\nDo not set the `ADDR` if you are running the server in a docker container.\n\n## SOME STATS\n\nUsing the following image: https://images8.alphacoders.com/133/1337846.png\n\nMy internet speed: 100mbps\nCPU: Ryzen 9 5900x\nRAM: 32gb 3600mhz\nDisk: NVME SSD\n\nResize dimensions 300x300\n\n| Type             | Size  | No Cache Times | Cached Times |\n| :--------------- | :---- | :------------- | :----------- |\n| no optimizations | 5.5mb | 2.84s          | 80ms         |\n| resize           | 158kb | 825ms          | 3ms          |\n| webp             | 148kb | 2.2s           | 2.5ms        |\n| webp+resize      | 7.2kb | 997ms          | 0.80ms       |\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliot40404%2Ficache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felliot40404%2Ficache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliot40404%2Ficache/lists"}