PlugResponseCache
A highly-configurable plug module to cache entire responses.
Installation
If available in Hex, the package can be installed by adding plug_response_cache
to your list of dependencies in mix.exs
:
def deps do
[
{:plug_response_cache, "~> 0.1.0"}
]
end
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/plug_response_cache.
Usage
See https://hexdocs.pm/plug_response_cache/
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
$ mix test
Contributing
Pull requests are welcome!
Credits
This package is based on the Laravel (PHP) response cache package by Spatie.
Alternative libraries
There are two similar libraries on Hex I know of.
- mneudert/plug_pagecache - Also supports an Agent cache
- andreapavoni/plug_ets_cache - Has more granular ttl configuration
No other implementations implement conditional caching based on the request or response, or dynamic expiration times.
License
The MIT License (MIT). Please check the LICENSE for more information.