{"id":13508292,"url":"https://github.com/alexocode/etag_plug","last_synced_at":"2025-12-11T23:39:37.967Z","repository":{"id":57497592,"uuid":"154814401","full_name":"alexocode/etag_plug","owner":"alexocode","description":"A simple to use shallow ETag plug","archived":false,"fork":false,"pushed_at":"2024-04-16T14:44:10.000Z","size":77,"stargazers_count":22,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-11-27T16:16:15.110Z","etag":null,"topics":["drop-in","elixir","etag","hacktoberfest","plug"],"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/alexocode.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-26T09:59:17.000Z","updated_at":"2024-04-16T13:34:39.000Z","dependencies_parsed_at":"2024-05-01T16:19:54.447Z","dependency_job_id":"a0dc698a-2dc5-41a5-bde7-81d18e94efa8","html_url":"https://github.com/alexocode/etag_plug","commit_stats":{"total_commits":43,"total_committers":4,"mean_commits":10.75,"dds":"0.39534883720930236","last_synced_commit":"7626ac865013d1c379f76cef7fd606ecedb5aa62"},"previous_names":["alexocode/etag_plug","sascha-wolf/etag_plug"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/alexocode/etag_plug","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexocode%2Fetag_plug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexocode%2Fetag_plug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexocode%2Fetag_plug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexocode%2Fetag_plug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexocode","download_url":"https://codeload.github.com/alexocode/etag_plug/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexocode%2Fetag_plug/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27458619,"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","status":"online","status_checked_at":"2025-12-02T02:00:06.387Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["drop-in","elixir","etag","hacktoberfest","plug"],"created_at":"2024-08-01T02:00:50.979Z","updated_at":"2025-12-11T23:39:37.944Z","avatar_url":"https://github.com/alexocode.png","language":"Elixir","readme":"# ETagPlug\n\n[![CircleCI](https://circleci.com/gh/alexocode/etag_plug.svg?style=svg)](https://circleci.com/gh/alexocode/etag_plug)\n[![Coverage Status](https://coveralls.io/repos/github/alexocode/etag_plug/badge.svg?branch=master)](https://coveralls.io/github/alexocode/etag_plug?branch=master)\n[![Hex.pm](https://img.shields.io/hexpm/v/etag_plug.svg)](https://hex.pm/packages/etag_plug/)\n[![License](https://img.shields.io/github/license/alexocode/etag_plug.svg)](https://github.com/alexocode/etag_plug/blob/master/LICENSE.md)\n\nThis plug generates shallow [ETags](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag).\n\nShallow means that it uses the whole response to generate the ETag and does not care about the specific content of each response. It is not context sensitive. For a deep (speak context sensitive) generation of ETags you can take a look at [Phoenix ETag](https://github.com/michalmuskala/phoenix_etag).\n\n**NOTE**:\nWhile this plug may seem stale, it's just stable.\nThere is nothing else to do, it \"just works\".\nAs such don't be afraid to use it in production. 🙂\n\n## Installation\n\nThe plug can be installed by adding `etag_plug` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:etag_plug, \"~\u003e 1.0\"}\n  ]\nend\n```\n\nDocumentation can be found at: [https://hexdocs.pm/etag_plug](https://hexdocs.pm/etag_plug)\n\n# Usage\n\nYou can simply use the plug without any configuration, it then defaults to the configuration as specified in the \"Configuration\" section.\n\n```elixir\nplug ETag.Plug\n```\n\nYou can also provide a number of options, see the \"Configuration\" section for details.\n\n```elixir\nplug ETag.Plug,\n  generator: MyCustomGenerator,\n  methods: [\"GET\", \"HEAD\"],\n  status_codes: [:ok, 201, :not_modified]\n```\n\n## Configuration\n\nA full configuration equal to the defaults could look like this:\n\n```elixir\nconfig :etag_plug,\n  generator: ETag.Generator.SHA1,\n  methods: [\"GET\"],\n  status_codes: [200]\n```\n\nEach of these options is explained in detail below.\n\n### `generator`\n\nExpects a module implementing the `ETag.Generator` behaviour. The plug ships with a number of \"default\" generators:\n\n- `ETag.Generator.MD5`\n- `ETag.Generator.SHA1`\n- `ETag.Generator.SHA512`\n\n__Default__: `Application.get_env(:etag_plug, :generator, ETag.Generator.SHA1)`\n\n### `methods`\n\nExpects a list of strings, describing the HTTP methods for which ETags should be generated and evaluated.\n\n__Default__: `Application.get_env(:etag_plug, :methods, [\"GET\"])`\n\n### `status_codes`\n\nExpects an enumerable of integers (or status atoms) which define the statuses for which ETags should be handled and generated.\n\n__Default__: `Application.get_env(:etag_plug, :status_codes, [200])`\n","funding_links":[],"categories":["HTTP"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexocode%2Fetag_plug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexocode%2Fetag_plug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexocode%2Fetag_plug/lists"}