{"id":16592412,"url":"https://github.com/hauleth/plug_early_hints","last_synced_at":"2025-08-24T03:35:30.714Z","repository":{"id":57534555,"uuid":"374647107","full_name":"hauleth/plug_early_hints","owner":"hauleth","description":null,"archived":false,"fork":false,"pushed_at":"2021-06-16T13:56:58.000Z","size":9,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-02T01:03:17.291Z","etag":null,"topics":["early-hints","elixir","elixir-lang","elixir-plug","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/hauleth.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":"2021-06-07T11:50:30.000Z","updated_at":"2024-01-28T10:25:15.000Z","dependencies_parsed_at":"2022-09-26T18:21:39.309Z","dependency_job_id":null,"html_url":"https://github.com/hauleth/plug_early_hints","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hauleth%2Fplug_early_hints","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hauleth%2Fplug_early_hints/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hauleth%2Fplug_early_hints/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hauleth%2Fplug_early_hints/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hauleth","download_url":"https://codeload.github.com/hauleth/plug_early_hints/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238803476,"owners_count":19533327,"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":["early-hints","elixir","elixir-lang","elixir-plug","hacktoberfest","plug"],"created_at":"2024-10-11T23:20:49.939Z","updated_at":"2025-02-14T07:31:58.933Z","avatar_url":"https://github.com/hauleth.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PlugEarlyHints\n\nConvenience plug for sending [HTTP 103 Early Hints][mdn-103].\n\nThis is useful for static resources that will be **for sure** required by\nthe resulting page. For example you can use it for informing the client\nthat you will need CSS later, so it can start fetching it right now.\n\n## Installation\n\n```elixir\ndef deps do\n  [\n    {:plug_early_hints, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\n## Usage\n\n```elixir\nplug PlugEarlyHints,\n  # List all resources that will be needed later when rendering page\n  paths: [\n    # External resources that will be connected to as we will use\n    # different resources from it. It will speedup as the TLS handshake\n    # will be already ended, so we will be able to fetch resources\n    # right away\n    \"https://gravatar.com/\": [rel: \"dns-prefetch\"],\n    \"https://gravatar.com/\": [rel: \"preconnect\"],\n    # \"Regular\" resources. We need to set `:as` to inform the client\n    # (browser) what kinf of resource it is, so it will be able to\n    # properly connect them\n    \"/css/app.css\": [rel: \"preload\", as: \"style\"],\n    \"/js/app.js\": [rel: \"preload\", as: \"script\"],\n    # Preloading fonts will require additional `:type` and `:crossorgin`\n    # to allow CSS engine to properly detect when apply the resource as\n    # well as to prevent double load.\n    \"/fonts/recursive.woff2\": [\n      rel: \"preload\",\n      as: \"font\",\n      crossorgin: :anonymous,\n      type: \"font/woff2\"\n    ]\n  ]\n```\n\nFor more information about available options check out [MDN `Link`][mdn-link].\n\n[mdn-103]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/103 \"103 Early Hints\"\n[mdn-link]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Link \"Link\"\n\n## License\n\nSee [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhauleth%2Fplug_early_hints","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhauleth%2Fplug_early_hints","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhauleth%2Fplug_early_hints/lists"}