{"id":14977604,"url":"https://github.com/pine/spring-cache-interceptors","last_synced_at":"2025-06-11T09:33:09.211Z","repository":{"id":57736818,"uuid":"190347720","full_name":"pine/spring-cache-interceptors","owner":"pine","description":":herb: Cache interceptors for SpringFramework","archived":false,"fork":false,"pushed_at":"2022-11-14T04:55:09.000Z","size":635,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-08T15:48:49.667Z","etag":null,"topics":["java","spring-boot","spring-framework"],"latest_commit_sha":null,"homepage":"https://search.maven.org/artifact/moe.pine/spring-cache-interceptors","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/pine.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":"2019-06-05T07:32:53.000Z","updated_at":"2025-02-22T12:51:43.000Z","dependencies_parsed_at":"2022-08-24T04:50:11.347Z","dependency_job_id":null,"html_url":"https://github.com/pine/spring-cache-interceptors","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pine%2Fspring-cache-interceptors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pine%2Fspring-cache-interceptors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pine%2Fspring-cache-interceptors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pine%2Fspring-cache-interceptors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pine","download_url":"https://codeload.github.com/pine/spring-cache-interceptors/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pine%2Fspring-cache-interceptors/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259239100,"owners_count":22826859,"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":["java","spring-boot","spring-framework"],"created_at":"2024-09-24T13:55:59.433Z","updated_at":"2025-06-11T09:33:09.187Z","avatar_url":"https://github.com/pine.png","language":"Java","readme":"# spring-cache-interceptors\n[![build](https://github.com/pine/spring-cache-interceptors/actions/workflows/build.yml/badge.svg)](https://github.com/pine/spring-cache-interceptors/actions/workflows/build.yml)\n[![codecov](https://codecov.io/gh/pine/spring-cache-interceptors/branch/master/graph/badge.svg)](https://codecov.io/gh/pine/spring-cache-interceptors)\n[![Maven Central](https://img.shields.io/maven-central/v/moe.pine/spring-cache-interceptors)](https://search.maven.org/artifact/moe.pine/spring-cache-interceptors)\n\n:herb: Cache interceptors for SpringFramework\n\n![](images/resized.jpg)\u003cbr\u003e\n\u003csup\u003e\u003csup\u003e\u0026copy; Pongnathee Kluaythong/123RF.COM\u003c/sup\u003e\u003c/sup\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n## Requirements\n\n- Java 8 or later\n- Spring Framework\n\n### Supported Spring Framework versions\n\n|Spring Framework versions|Spring Boot versions|This library version|\n|-------------------------|--------------------|--------------------|\n|5.3                      |2.4, 2.5, 2.6, 2.7  |0.2.1               |\n|5.2                      |2.2, 2.3            |0.1.3               |\n\n## Getting started\nThe library is published to Maven Central.\n\n```gradle\nrepositories {\n    mavenCentral()\n}\n\ndepepdencies {\n    implementation \"moe.pine:spring-cache-interceptors:$latestVersion\"\n}\n```\n\n## Usage\nYou can create a new interceptor with Spring Framework as following.\n\n```java\nimport moe.pine.spring.cache.interceptors.CacheInterceptor;\nimport moe.pine.spring.cache.interceptors.CachePolicy;\nimport moe.pine.spring.cache.interceptors.CachePolicyBuilder;\n\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.web.servlet.config.annotation.InterceptorRegistry;\nimport org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n@Configuration\npublic class WebMvcConfig implements WebMvcConfigurer {\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        final CachePolicy cachePolicy = new CachePolicyBuilder()\n            .public_()\n            .maxAge(3600L)\n            .build();\n        final CacheInterceptor cacheInterceptor = new CacheInterceptor(cachePolicy);\n\n        registry\n            .addInterceptor(cacheInterceptor)\n            .addPathPatterns(\"/**\");\n    }\n}\n```\n\n\n## Development\n### Test\n\n```\n$ ./gradlew clean check\n```\n\n### Upload Maven Central\n\n```\n$ ./gradlew clean publish\n```\n\n## License\n\nMIT \u0026copy; [Pine Mizune](https://profile.pine.moe)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpine%2Fspring-cache-interceptors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpine%2Fspring-cache-interceptors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpine%2Fspring-cache-interceptors/lists"}