{"id":13695622,"url":"https://github.com/KarelCemus/play-redis","last_synced_at":"2025-05-03T13:32:41.279Z","repository":{"id":27651585,"uuid":"31136759","full_name":"KarelCemus/play-redis","owner":"KarelCemus","description":"Play framework 2 cache plugin as an adapter to redis-server","archived":false,"fork":false,"pushed_at":"2024-05-07T10:26:27.000Z","size":1196,"stargazers_count":165,"open_issues_count":0,"forks_count":42,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-08-03T18:19:50.109Z","etag":null,"topics":["asynchronous","play-cache","play-framework","play-redis","playframework","reactive","redis-cache","scala"],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KarelCemus.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2015-02-21T18:59:01.000Z","updated_at":"2024-07-18T03:47:03.000Z","dependencies_parsed_at":"2024-02-07T11:51:22.004Z","dependency_job_id":"2c727f20-6e2d-47e1-8c2d-5de361a93311","html_url":"https://github.com/KarelCemus/play-redis","commit_stats":null,"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarelCemus%2Fplay-redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarelCemus%2Fplay-redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarelCemus%2Fplay-redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarelCemus%2Fplay-redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KarelCemus","download_url":"https://codeload.github.com/KarelCemus/play-redis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224364341,"owners_count":17299052,"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":["asynchronous","play-cache","play-framework","play-redis","playframework","reactive","redis-cache","scala"],"created_at":"2024-08-02T18:00:31.168Z","updated_at":"2025-05-03T13:32:41.266Z","avatar_url":"https://github.com/KarelCemus.png","language":"Scala","funding_links":[],"categories":["Libraries"],"sub_categories":["Databases"],"readme":"\u003cdiv align=\"center\"\u003e\n\n  # Redis Cache module for Play framework\n\n  **This version supports Play framework 3.0.x with JDK 11 and Scala 2.13 and Scala 3.**\u003cbr/\u003e\n  **For previous versions see older releases.**\n\n  [![Travis CI: Status](https://travis-ci.org/KarelCemus/play-redis.svg?branch=master)](https://travis-ci.org/KarelCemus/play-redis)\n  [![Coverage Status](https://coveralls.io/repos/github/KarelCemus/play-redis/badge.svg?branch=master)](https://coveralls.io/github/KarelCemus/play-redis?branch=master)\n  [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.karelcemus/play-redis_2.13/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.karelcemus/play-redis_2.13)\n\n\u003c/div\u003e\n\n\n## About the Project\n\n[Play framework](https://playframework.com/) is delivered with\n[SyncCacheApi and AsyncCacheApi](https://playframework.com/documentation/2.8.x/ScalaCache).\nThis module provides **implementation of a cache over Redis** server, i.e., key/value storage.\n\nBesides the compatibility with all Play's cache APIs,\nit introduces more evolved API providing lots of handful\noperations. Besides the basic methods such as `get`, `set`\nand `remove`, it provides more convenient methods such as\n`expire`, `exists`, `invalidate` and much more.\n\nThe implementation builds on the top of Pekko actor system,\nit is **completely non-blocking and asynchronous** under\nthe hood, though it also provides blocking APIs to ease\nthe use. Furthermore, the library supports several configuration\nproviders to let you easily use `play-redis` on localhost, Heroku,\nas well as on your premise.\n\n\n## Features\n\n- [synchronous and asynchronous APIs](#provided-apis)\n- [implements standard APIs defined by Play's `cacheApi` project](#provided-apis)\n- support of [named caches](https://github.com/KarelCemus/play-redis/blob/5.2.0/doc/20-configuration.md#named-caches)\n- [works with Guice](https://github.com/KarelCemus/play-redis/blob/5.2.0/doc/40-migration.md#runtime-time-dependency-injection) as well as [compile-time DI](https://github.com/KarelCemus/play-redis/blob/5.2.0/doc/40-migration.md#compile-time-dependency-injection)\n- [getOrElse and getOrFuture operations](https://github.com/KarelCemus/play-redis/blob/5.2.0/doc/30-how-to-use.md#use-of-cacheapi) easing the use\n- [wildcards in remove operation](https://github.com/KarelCemus/play-redis/blob/5.2.0/doc/30-how-to-use.md#use-of-cacheapi)\n- support of collections: [sets](https://github.com/KarelCemus/play-redis/blob/5.2.0/doc/30-how-to-use.md#use-of-sets), [lists](https://github.com/KarelCemus/play-redis/blob/5.2.0/doc/30-how-to-use.md#use-of-lists), and [maps](https://github.com/KarelCemus/play-redis/blob/5.2.0/doc/30-how-to-use.md#use-of-maps)\n- [increment and decrement operations](https://github.com/KarelCemus/play-redis/blob/5.2.0/doc/30-how-to-use.md#use-of-cacheapi)\n- [eager and lazy invocation policies](https://github.com/KarelCemus/play-redis/blob/5.2.0/doc/20-configuration.md#eager-and-lazy-invocation) waiting or not waiting for the result\n- several [recovery policies](https://github.com/KarelCemus/play-redis/blob/5.2.0/doc/20-configuration.md#recovery-policy) and possibility of further customization\n- support of [several configuration sources](https://github.com/KarelCemus/play-redis/blob/5.2.0/doc/20-configuration.md#running-in-different-environments)\n    - static in the configuration file\n    - from the connection string optionally in the environmental variable\n    - custom implementation of the configuration provider\n- support of [standalone, cluster,](https://github.com/KarelCemus/play-redis/blob/5.2.0/doc/20-configuration.md#standalone-vs-cluster)\n  [aws-cluster,](https://github.com/KarelCemus/play-redis/blob/5.2.0/doc/20-configuration.md#aws-cluster)\n  and [sentinel modes](https://github.com/KarelCemus/play-redis/blob/5.2.0/doc/20-configuration.md#sentinel)\n- build on the top of Pekko actors and serializers, [agnostic to the serialization mechanism](https://github.com/KarelCemus/play-redis/blob/5.2.0/doc/20-configuration.md#limitation-of-data-serialization)\n    - for simplicity, it uses deprecated Java serialization by default\n      - it is recommended to use [Kryo library](https://github.com/romix/akka-kryo-serialization) or any other mechanism\n\n\n## Provided APIs\n\nThis library delivers a single module with following implementations of the API. While the core\nof the framework is **fully non-blocking**, most of the provided facades are **only blocking wrappers**.\n\n\u003ccenter\u003e\n\n|    | Trait                                | Language | Blocking     | Features |\n| -- | ------------------------------------ | :------: | :----------: | :------: |\n| 1. | `play.api.cache.redis.CacheApi`      | Scala    | *blocking*   | advanced |\n| 2. | `play.api.cache.redis.CacheAsyncApi` | Scala    | non-blocking | advanced |\n| 3. | `play.cache.redis.AsyncCacheApi`     | Java     | non-blocking | advanced |\n| 4. | `play.api.cache.SyncCacheApi`        | Scala    | *blocking*   | basic    |\n| 5. | `play.api.cache.AsyncCacheApi`       | Scala    | non-blocking | basic    |\n| 6. | `play.cache.SyncCacheApi`            | Java     | *blocking*   | basic    |\n| 7. | `play.cache.AsyncCacheApi`           | Java     | non-blocking | basic    |\n\n\u003c/center\u003e\n\nFirst, the `CacheAsyncApi` provides extended API to work with Redis and enables **non-blocking**\nconnection providing results through `scala.concurrent.Future`.\nSecond, the `CacheApi` is a thin **blocking** wrapper around the asynchronous implementation.\nThird, there are other implementations supporting contemporary versions of the `CacheApi`s\nbundled within Play framework. Finally, `play-redis` also supports Java version of the API,\nthough it is primarily **designed for and more efficient with Scala**.\n\n\n## Documentation and Getting Started\n\n**[The full documentation](https://github.com/KarelCemus/play-redis/)**\nis in the `doc` directory. **The documentation for a particular version**\nis under [the particular tag in the Git history](https://github.com/KarelCemus/play-redis/releases)\nor you can use shortcuts in the table below.\n\nTo use this module:\n\n1. [Add this library into your project](https://github.com/KarelCemus/play-redis/blob/5.2.0/doc/10-integration.md) and expose APIs\n1. See the [configuration options](https://github.com/KarelCemus/play-redis/blob/5.2.0/doc/20-configuration.md)\n1. [Browse examples of use](https://github.com/KarelCemus/play-redis/blob/5.2.0/doc/30-how-to-use.md)\n\nIf you come from older version, you might check the [Migration Guide](https://github.com/KarelCemus/play-redis/blob/5.2.0/doc/40-migration.md)\n\n\n## Samples\n\nTo ease the initial learning, there are\n[several sample projects](https://github.com/KarelCemus/play-redis-samples)\nintended to demonstrate the most common configurations. Feel free\nto study, copy or fork them to better understand the `play-redis` use.\n\n\n1. [**Getting Started**](https://github.com/KarelCemus/play-redis-samples/tree/master/hello_world) is a very basic example showing the\nminimal configuration required to use the redis cache\n\n1. [**Named Caches**](https://github.com/KarelCemus/play-redis-samples/tree/master/named_caches) is the advanced example with custom recovery policy and multiple named caches.\n\n1. [**EhCache and Redis**](https://github.com/KarelCemus/play-redis-samples/tree/master/redis_and_ehcache) shows a combination of both caching provides used at once.\nWhile the EhCache is bound to unqualified APIs, the Redis cache uses named APIs.\n\n\n## How to add the module into the project\n\nTo your SBT `build.sbt` add the following lines:\n\n```scala\n// enable Play cache API (based on your Play version)\nlibraryDependencies += play.sbt.PlayImport.cacheApi\n// include play-redis library\nlibraryDependencies += \"com.github.karelcemus\" %% \"play-redis\" % \"5.2.0\"\n```\n\n\n## Compatibility matrix\n\n| play framework |                          play-redis |                                                                                                                                                          documentation |\n|----------------|------------------------------------:|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------:|\n| 3.0.x          |    \u003c!-- Play 3.0 --\u003e5.2.0\u003c!-- / --\u003e |                                                                                              [see here](https://github.com/KarelCemus/play-redis/blob/5.2.0/README.md) |\n| 2.9.x          |    \u003c!-- Play 2.9 --\u003e3.0.0\u003c!-- / --\u003e |                                                                                             [see here](https://github.com/KarelCemus/play-redis/blob/3.0.0/README.md) |\n| 2.8.x          |    \u003c!-- Play 2.8 --\u003e2.7.0\u003c!-- / --\u003e |                                                                                              [see here](https://github.com/KarelCemus/play-redis/blob/2.7.0/README.md) |\n| 2.7.x          |    \u003c!-- Play 2.7 --\u003e2.5.1\u003c!-- / --\u003e |                                                                                              [see here](https://github.com/KarelCemus/play-redis/blob/2.5.1/README.md) |\n| 2.6.x          |    \u003c!-- Play 2.6 --\u003e2.3.0\u003c!-- / --\u003e | [see here](https://github.com/KarelCemus/play-redis/blob/2.3.0/README.md) ([Migration Guide](https://github.com/KarelCemus/play-redis/blob/2.3.0/doc/40-migration.md)) |\n| 2.5.x          |    \u003c!-- Play 2.5 --\u003e1.4.2\u003c!-- / --\u003e |                                                                                              [see here](https://github.com/KarelCemus/play-redis/blob/1.4.2/README.md) |\n| 2.4.x          |    \u003c!-- Play 2.4 --\u003e1.0.0\u003c!-- / --\u003e |                                                                                              [see here](https://github.com/KarelCemus/play-redis/blob/1.0.0/README.md) |\n| 2.3.x          |    \u003c!-- Play 2.3 --\u003e0.2.1\u003c!-- / --\u003e |                                                                                              [see here](https://github.com/KarelCemus/play-redis/blob/0.2.1/README.md) |\n\n\n## Contribution\n\nIf you encounter any issue, have a feature request, or just\nlike this library, please feel free to report it or contact me.\n\n\n## Changelog\n\nFor the list of changes and migration guide please see\n[the Changelog](https://github.com/KarelCemus/play-redis/blob/5.2.0/CHANGELOG.md).\n\n\n## Caveat\n\nThe library **does not enable** the redis module by default. It is to avoid conflict with Play's default EhCache\nand let the user define when use Redis. This allows you to use EhCache in your *dev* environment and\nRedis in *production*. You can also combine the modules using named caches.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKarelCemus%2Fplay-redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FKarelCemus%2Fplay-redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKarelCemus%2Fplay-redis/lists"}