{"id":25720131,"url":"https://github.com/gregwhitaker/etag-example","last_synced_at":"2026-04-15T21:31:23.180Z","repository":{"id":82732520,"uuid":"226699751","full_name":"gregwhitaker/etag-example","owner":"gregwhitaker","description":"Example of Shallow E-Tags in Spring Boot","archived":false,"fork":false,"pushed_at":"2020-12-10T16:40:37.000Z","size":128,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-18T21:19:49.270Z","etag":null,"topics":["etag","etags","rest-api","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","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/gregwhitaker.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}},"created_at":"2019-12-08T16:48:34.000Z","updated_at":"2020-12-10T16:40:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"474519eb-72e2-4372-96f9-b57e01453a2d","html_url":"https://github.com/gregwhitaker/etag-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gregwhitaker/etag-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregwhitaker%2Fetag-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregwhitaker%2Fetag-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregwhitaker%2Fetag-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregwhitaker%2Fetag-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gregwhitaker","download_url":"https://codeload.github.com/gregwhitaker/etag-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregwhitaker%2Fetag-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31861278,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"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":["etag","etags","rest-api","spring-boot"],"created_at":"2025-02-25T17:36:39.232Z","updated_at":"2026-04-15T21:31:23.158Z","avatar_url":"https://github.com/gregwhitaker.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# etag-example\n![Build](https://github.com/gregwhitaker/etag-example/workflows/Build/badge.svg)\n\nAn example of shallow ETags in Spring Boot.\n\nShallow ETags only provide benefits to the client as they still require the same processing as any other request on the server side.\n\n## Prerequisites\nThis example requires a running PostgreSQL database.\n\nYou can start an instance as a Docker container by running the following command:\n\n    docker run -d -p 5432:5432 postgres\n\n## Building the Example\nRun the following command to build the example application as a Docker image:\n\n    ./gradlew clean buildImage\n    \n## Running the Example\nFollow the steps below to run the example:\n\n1. Ensure you have a running PostgreSQL database on port `5432`. If you do not, you can start one in a Docker container by\nrunning the following command:\n\n        docker run -d -p 5432:5432 postgres\n\n2. Start the example application by running the following command:\n\n        docker run --rm -e SPRING_PROFILES_ACTIVE='localdocker' -p 8080:8080 gregnetifi/etag-example\n        \n3. In a new terminal, run the following to get the product information for product `001`:\n\n        curl -v http://localhost:8080/products/001\n        \n    If successful, you will receive a large JSON response with the product information.\n    \n4. Get the value of the `ETag` header from the response:\n\n        ETag: \"09564cf9d39419c13e93fe29bb4867a8b\"\n        \n5. Run the following command to retrieve the product information for product `001` again, but this time specify the ETag to check in the `If-None-Match` header:\n\n        curl -v --header \"If-None-Match: \\\"09564cf9d39419c13e93fe29bb4867a8b\\\"\" http://localhost:8080/products/001\n        \n    If successful, you will see that a `304 - Not Modified` HTTP status code was returned. This indicates that the object has not changed since you last requested it.\n    Since the object has not changed it was not returned to prevent unnecessary client-side processing.\n    \n6. Now, run the following command to modify the `active` state of the product to `false`:\n\n        curl -v -X DELETE http://localhost:8080/products/001/active\n        \n    If successful, you will receive a `204 - No Content` HTTP status code.\n    \n7. Next, run the GET command with the ETag you previously ran (below for convenience) to retrieve the product. \n\n        curl -v --header \"If-None-Match: \\\"09564cf9d39419c13e93fe29bb4867a8b\\\"\" http://localhost:8080/products/001\n        \n    Notice that the entire JSON response was returned with a new `ETag` header. This is because the product has been modified since you last requested it.\n    \n## Bugs and Feedback\nFor bugs, questions, and discussions please use the [Github Issues](https://github.com/gregwhitaker/etag-example/issues).\n\n## License\nMIT License\n\nCopyright (c) 2019 Greg Whitaker\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregwhitaker%2Fetag-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgregwhitaker%2Fetag-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregwhitaker%2Fetag-example/lists"}