{"id":16398831,"url":"https://github.com/sauldoescode/transplacer","last_synced_at":"2026-01-11T22:57:28.547Z","repository":{"id":59044720,"uuid":"156714757","full_name":"SaulDoesCode/transplacer","owner":"SaulDoesCode","description":"it reads files \u0026 suspends them in memory for performant serving/access","archived":false,"fork":false,"pushed_at":"2018-11-24T11:30:43.000Z","size":80,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-23T09:43:29.011Z","etag":null,"topics":["assetcache","cache","http2","http2-push","memory-database","push","serving","static"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SaulDoesCode.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}},"created_at":"2018-11-08T13:56:26.000Z","updated_at":"2023-03-28T18:29:06.000Z","dependencies_parsed_at":"2022-09-11T06:51:02.330Z","dependency_job_id":null,"html_url":"https://github.com/SaulDoesCode/transplacer","commit_stats":null,"previous_names":["sauldoescode/mak"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/SaulDoesCode/transplacer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaulDoesCode%2Ftransplacer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaulDoesCode%2Ftransplacer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaulDoesCode%2Ftransplacer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaulDoesCode%2Ftransplacer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SaulDoesCode","download_url":"https://codeload.github.com/SaulDoesCode/transplacer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaulDoesCode%2Ftransplacer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263182287,"owners_count":23426637,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["assetcache","cache","http2","http2-push","memory-database","push","serving","static"],"created_at":"2024-10-11T05:14:01.994Z","updated_at":"2026-01-11T22:57:28.503Z","avatar_url":"https://github.com/SaulDoesCode.png","language":"Go","readme":"[![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/SaulDoesCode/transplacer)\n\n## Features\n\n* auto http2 push, when available\n* auto watching and updating\n* gzips and sets etags\n* works concurrently, no deadlocks\n* it's a bit of rough magic \u0026 ducktape, but, it works\n\n\n## Diy AssetCache for super fast static asset serving straight from the memory\n```go\npackage main\n\nimport (\n  \"log\"\n  \"net/http\"\n  \"time\"\n\n  tr \"github.com/SaulDoesCode/transplacer\"\n)\n\nfunc main() {\n  cache, err := tr.Make(\u0026tr.AssetCache{\n    Dir:     \"./assets\",\n    Watch:   true,\n    Expire:  time.Minute * 30,\n    DevMode: true, // extra logs\n  })\n  if err != nil {\n    panic(err.Error())\n  }\n  defer cache.Close()\n\n  server := \u0026http.Server{\n    Addr:    \":http\",\n    Handler: cache,\n  }\n\n  log.Fatal(server.ListenAndServe())\n}\n```\n\nWith Echo \n```go\npackage main\n\nimport (\n  \"time\"\n\n  tr \"github.com/SaulDoesCode/transplacer\"\n  \"github.com/labstack/echo\"\n)\n\nfunc main() {\n  cache, err := tr.Make(\u0026tr.AssetCache{\n    Dir:    \"./assets\",\n    Watch:  true,\n    Expire: time.Minute * 30,\n  })\n  if err != nil {\n    panic(err.Error())\n  }\n  defer cache.Close()\n\n  e := echo.New()\n\n  e.Use(func(next echo.HandlerFunc) echo.HandlerFunc {\n    return func(c echo.Context) error {\n      req := c.Request()\n      err := next(c)\n      if err == nil || req.Method[0] != 'G' {\n        return err\n      }\n\n      return cache.Serve(c.Response().Writer, req)\n    }\n  })\n\n  e.Logger.Fatal(e.Start(\":http\"))\n}\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsauldoescode%2Ftransplacer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsauldoescode%2Ftransplacer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsauldoescode%2Ftransplacer/lists"}