{"id":13507524,"url":"https://github.com/OpenWeb-Archive/gen_spoxy","last_synced_at":"2025-03-30T09:32:55.586Z","repository":{"id":62429765,"uuid":"119197137","full_name":"OpenWeb-Archive/gen_spoxy","owner":"OpenWeb-Archive","description":"**DEPRECATED** caching made fun!","archived":true,"fork":false,"pushed_at":"2019-01-13T16:13:43.000Z","size":65,"stargazers_count":22,"open_issues_count":0,"forks_count":0,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-04-21T07:08:36.923Z","etag":null,"topics":["deprecated","elixir","in-memory-caching"],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/OpenWeb-Archive.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-27T19:50:24.000Z","updated_at":"2023-09-01T08:52:29.000Z","dependencies_parsed_at":"2022-11-01T20:06:23.867Z","dependency_job_id":null,"html_url":"https://github.com/OpenWeb-Archive/gen_spoxy","commit_stats":null,"previous_names":["spotim/gen_spoxy"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenWeb-Archive%2Fgen_spoxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenWeb-Archive%2Fgen_spoxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenWeb-Archive%2Fgen_spoxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenWeb-Archive%2Fgen_spoxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenWeb-Archive","download_url":"https://codeload.github.com/OpenWeb-Archive/gen_spoxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246301963,"owners_count":20755512,"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":["deprecated","elixir","in-memory-caching"],"created_at":"2024-08-01T02:00:35.674Z","updated_at":"2025-03-30T09:32:55.258Z","avatar_url":"https://github.com/OpenWeb-Archive.png","language":"Elixir","funding_links":[],"categories":["Caching","reverse-proxy"],"sub_categories":[],"readme":"# GenSpoxy\n\n## DEPRECATION WARNING\n\n**This package is now deprecated in favor of [Shielded Cache](https://github.com/SpotIM/shielded-cache). It is no longer being used in production nor is it being maintained.**\n\n## Package Information\n\nthe `GenSpoxy` package consist of battle-tested abstractions that help creating in-memory caching\n\n### Advantages of `GenSpoxy`:\n1. Makes it very easy to create from scratch highly-concurrent applicative reverse-proxy\nthat holds an internal short-lived (configurable) cache.\n1. CDN like Origin Shielding - when multiple clients ask for the same request and experience a cache miss,\nthe calculation will be done only once\n1. Supports non-blocking mode for requests that are willing to receive stale cached data\n1. Eases the time-to-market of features that require some caching\n\n### notes:\n1. The default cache storage used is `ETS`\n1. The default behaviour is `non-blocking`\n1. Each request should be transformed to a signature deterministically (a.k.a. `req_key`)\n\n\n### usage example:\n```elixir\ndefmodule SampleCache do\n  use GenSpoxy.Cache, prerender_module: SamplePrerender\nend\n\ndefmodule SamplePrerender do\n  use GenSpoxy.Prerender\n\n  @impl true\n  def do_req(req) do\n    # slow calculation of `req`\n  end\n\n  @impl true\n  def calc_req_key(req) do\n    Enum.join(req, \"-\")\n  end\nend\n\n# usage\nopts = [\n  table_name: \"sample-table\",\n  do_janitor_work: true, # whether we garbage collect expired data\n  ttl_ms: 5_000 # the data is considered non-stale for 5 seconds\n]\n\n# `req` is application dependant\nreq = %{url: \"https://www.very-slow-server.com\", platform: \"mobile\"}\n\nSampleCache.get_or_fetch(req, opts)  # blocking manner\n\nSampleCache.async_get_or_fetch(req, opts)  # async manner (we're OK with accepting a stale response)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenWeb-Archive%2Fgen_spoxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FOpenWeb-Archive%2Fgen_spoxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenWeb-Archive%2Fgen_spoxy/lists"}