{"_id":"strapi-middleware-cache","_rev":"34-1ca7157f1657ce28f5d0d090ed4db7e0","name":"strapi-middleware-cache","dist-tags":{"latest":"2.1.8","beta":"2.1.0"},"versions":{"1.0.0":{"name":"strapi-middleware-cache","version":"1.0.0","description":"Cache strapi requests","main":"./lib","keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","redis":"^3.0.2","redis-lru":"^0.6.0"},"gitHead":"fe62d620ca42a5d114c7cbd18005758aa18035a4","_id":"strapi-middleware-cache@1.0.0","_nodeVersion":"12.16.2","_npmVersion":"6.14.4","dist":{"integrity":"sha512-pL2RevJhlvXEHmVsmPt9c9tZQEKuciGW5/nZJG3wZLa3D6V3avQ2ee8EwG6WmRG/ofdzdwqmh38sQR4qQF1vZA==","shasum":"564117516fd8754c7f268b547586632e252b76c5","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-1.0.0.tgz","fileCount":10,"unpackedSize":12267,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJelaGtCRA9TVsSAnZWagAA5w4P/j4fpeMC+Nu4o9EQDcjb\nATUIrgef/1XwNvhHIM3x6RbxBeGyVLGNyIGr9xwCzIL7ed0eXyeSR8ns6aln\n7L8iv34wF3LkfPmc2ZUOlMzblWP3LOQrMUhS+8slEovcnON5knCfJ3c8pyJl\nmCvIj57ik1q7beS+ijzf2QMIsssEdZ5kDESOqkb+9sQpouGH01Ueyl/IJ+An\nN2oPFkiNplErwAcZKf41IZ59IkMeg424X95Pwm00I3olGqBHYaUNBuPPbyct\n/krqHbSuaCdpkFlAtPiChCkAvSwWm3/SW9QNOfeihnFRvzNT9x3O8AIBXlt+\nlfYSZrwtyyZbn4nApWt9YZEZK4kh8G+9mnpd5uFoz4lbIUbPr4N++hR3ibEE\n9I1N/x3yG37ohjToRyLrRjgg6keYtEb++q3o6oKdYhpt2b1/Ju659EvMwxkd\nfphpR22E8NvXUdk7f6q651z8qcgSw/gSnF99dXSFySS/sctOBRLYu8Q/J6tq\ns8ZYt2oAh0a4G0KzRF4jtnUP2Py9H+LBkktjbSPj+C+CPNP4aBk+q1IihIS+\n5T+PsbIT2I8U18BmjLAMCdS8Uej9hyeaMFCIUmGsIE5bu8143CiaxwVUqOtb\nrO/ng7XYOjQqQu3aT29QyvKaJGRdeIJxK4LFZeIzb7Wd5lXtma1Q+YzprzOz\nJyL5\r\n=CfXP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDWeqtZc9FZMNRGAOR2xY+0VXxRqjsoFOI7dc1XADjenAIhAOrvHrmV4jWIWBry/Zf85g6OJ8kK8qH0PEf5GsSR9vjh"}]},"maintainers":[{"name":"patrixr","email":"patrick@tronica.io"}],"_npmUser":{"name":"patrixr","email":"patrick@tronica.io"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_1.0.0_1586864557471_0.1870027286624103"},"_hasShrinkwrap":false},"1.0.1":{"name":"strapi-middleware-cache","version":"1.0.1","description":"Cache strapi requests","main":"./lib","scripts":{"test":"mocha ./tests/*.test.js"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","redis":"^3.0.2","redis-lru":"^0.6.0"},"devDependencies":{"chai":"^4.2.0","koa":"^2.11.0","mocha":"^7.1.1","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2"},"gitHead":"adb2f143f3c6d047c5dc5a117a4844869f682588","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@1.0.1","_nodeVersion":"12.16.2","_npmVersion":"6.14.4","dist":{"integrity":"sha512-VktmV2gARv1bsjZm4zNDM5ucBNQvJNgbYXItrNGgq24qarIotyYB9R7L2XJ164zoYQsC5OMj17nWcVlQG1VlfQ==","shasum":"1344cbda58a91c0126151910387e2692933a92e3","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-1.0.1.tgz","fileCount":12,"unpackedSize":15119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJelevECRA9TVsSAnZWagAA9UEP/1fm4g24j/drsc+vOpBI\n/2cOV6/winiBENpq3Un+NeJSx03+CE8Wv5jWQqzpnumOc4O/QalFlF2Puh3v\nkCZhJHLmfKx3lQRrruoTd4ULlvPuTs+MLpsnD8BYjKOeiesVM94QXC3MFTuF\nGKHbWG3CKP/t7RQDHjdXF6DoHQpZx+9zgFX1C28xVcAIJLy76BORAqH6K2E+\n+4xt7RcSiSvYV4iM1yFzXuG4IykSEDZHXJpeMnvtISU2oIgmnn7s0lqZLPHi\noMwm3RvJHH6CBXgNF/j/hSComppigXL26VlwD7R5E9+7p910H1OnW4Q5M7jt\n7lPslC/iHcarOv/hmxnPPEfcn1RjxabOV5awVL7vh5W3K1hNeTzGScWcGlWc\nOCcQrJZ7gi/m2fIny/z+MU/fSOoFed6Ey2JpSYDzds9Lidu57Ln+6VHnkWG1\n/CgIKhduFLKi4h211+/InDi0msf2YTmXZeFQYu9dqlp+N3Rtz2lgjwiP9nBy\nWQSwYkjOkZHtZH272siQxLBy7/1tGUI3mfuaALxyCcGEV2zbv0Uvgk7MKPSW\nKbqeCC0EEmUI+iNd06eiH7EOim9jqKaVyY51KAvQpEKfPjiwqZBjaPdu4oty\n8aEwGzIvTFX2QHB/lku3l6E+ukPedSo4LT5lSE1TisW7nq2x1MPol8xtDftq\nMee2\r\n=nY/h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEzv7Z8SxC3UDZE6o7UaMv11ClZNUpyLMzq/QwNj5+U8AiAfnWLcO4OOPgRPe8KuN2lv7VyYqWltRY+2g79fbvuEdg=="}]},"maintainers":[{"name":"patrixr","email":"patrick@tronica.io"}],"_npmUser":{"name":"patrixr","email":"patrick@tronica.io"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_1.0.1_1586883523492_0.9557716729204302"},"_hasShrinkwrap":false},"1.0.2":{"name":"strapi-middleware-cache","version":"1.0.2","description":"Cache strapi requests","main":"./lib","scripts":{"test":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","redis-lru":"^0.6.0"},"devDependencies":{"chai":"^4.2.0","koa":"^2.11.0","mocha":"^7.1.1","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2"},"gitHead":"8733bbcb585ff12e706e1f44f8f40d1e26f942d2","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@1.0.2","_nodeVersion":"12.16.3","_npmVersion":"6.14.4","dist":{"integrity":"sha512-4qTGfRTyAGwwfW6fSA3ZhZrwPvpwwCx9b2HIVaLtZpLS46V/kD2xkcLYB9N2PoMwcWy52tnICJ0MYTwhwNjWug==","shasum":"ced1620f138a54b4219b6071f3e4b802b21d39eb","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-1.0.2.tgz","fileCount":13,"unpackedSize":16071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewfwdCRA9TVsSAnZWagAA5akQAJcLFMhjXn1VE/vUuX30\nteuV/yDahWcjLwvYoujUzCbbigPCMUKejb7DWkyv4KtdMz4d3LhBruIS1ZEq\n9inruYwB2VQjWtC4E6G+vhx889x82QE+ruADyfYICWrsKXfNfvGAGygfmSSb\nBSb+6FsWQWxJmmy8UY8PLjq6Mz4nHRLd5iRuqVHpJOsQZbzYfmbrsdlb/1S2\nHPQxkYGQC++WjLpB2qTIk0w6RPjX0AiFDIEO7Qv9PFcx9c5j868/fjdeoCEI\nhugUMj4efE0/XYcZl2a70l7I4ukujXZqNcsfFgQAZvti4ePpcVRMO6ZcWrg4\nNyYWZ/zElgVYn/4CevyZQtrskLJgO7XhGSTrrfKszOTNOGHnxcseW5N9hT7X\nrflPB7MNQduFQF1xBS6KnNeNClksszrIuqQS6+uodqrAKtC+PNdXUi/Vvd79\nkxi8riKKc43yvvQLcORvPsjTkPK+odODcoqYryA14Y0FsQi/CUSCzuQhUjer\n6QaCPdADsbUdQcSnumQIU+x0xmCnER7sdw2qvMH5rZcRFJtQ4nrmcXx5pOhI\n+NJR5AqUnRzr5xy6ws7iEOZ1TikvVOfgNYQnXs9s9UqxtAEhpBYCgGOeVSwy\nCo2+WSy0TxaA/2M+Uj+QD+7v2pObNuMSQRV9NinCxTk3yXxygWCbKG66FRz0\nxM4e\r\n=W8Ie\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICW4Ab7C3BwpjYfaFWrFrc6A9CJLC2jTss2uZasI+NWbAiEAnif6wp2WAs1HcDnxJTyY9lNQniBjdvjqB8tpQOShgFY="}]},"maintainers":[{"name":"patrixr","email":"patrick@tronica.io"}],"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_1.0.2_1589771292900_0.1117779008830353"},"_hasShrinkwrap":false},"1.0.3":{"name":"strapi-middleware-cache","version":"1.0.3","description":"Cache strapi requests","main":"./lib","scripts":{"test":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","redis-lru":"^0.6.0"},"devDependencies":{"chai":"^4.2.0","koa":"^2.11.0","mocha":"^7.1.1","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2"},"gitHead":"325cffbf3f587282442912423c1ebef81b630772","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@1.0.3","_nodeVersion":"12.16.3","_npmVersion":"6.14.4","dist":{"integrity":"sha512-4fWjTbJywIkQQHBJ1wJLOmPYSY9vLH7L+812Q1imq8kdCTJ411nqYKacM00iimkOgK2Zx2zNOwQo6DcjlvdpcA==","shasum":"9dc0a56faa78cbc723814d164d20e579f83541b6","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-1.0.3.tgz","fileCount":13,"unpackedSize":15658,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewjVTCRA9TVsSAnZWagAAN34P/iFC/NPDvZQ3m/FK7dTd\nW8XjhXdIr8WCf9RNO0gOH587g2g0BbgBa5FL605bBPlz/eNMtbwN6RhyhtYu\nIhpSyxs0ra+fMogL0pqJj2BtxnLW37XVJkuR2uVfWK9+MiHgcWwmGRkSCZDA\nczmETLtaOVawj8UGQpq/L9Qy6nvbc5VnFvE4lpvGI+gaN9gsEISxknQ0KUp2\n43ByKIJ4jovTjl3xG9+rU/hCdONgxKY6x9Te1v6M6uv+C+gYfH9dYZb5XHlx\nOZOhhwQoixS54zI7+y++BI7pHN1e8SAYAtnJqKZn7ikEuhjYj2DrANyDHowI\nCFd4Bvd9xNoWUHC7WvoTxUH9vvyUkdvHh9arc8aINYqOeJHbQwpl8X/QAmWI\nRlfrVnQI57h0YZYQep3b9s7EELzXj0233R3rpSLAMhG7inc2HeCqgFKsRd66\nm19DAP/YdQKXsUD7tEmjdGYv39sKl2e9Wk/I3BWP6NzMcj0K8gREgfK3qpjJ\nCMSTr8YJAuRbOncGYIl6J9fPVQdcEWeua5RRCyECYGwjQ3XMg24avB7LMfCg\nkyXrVSl8IUc6Sn8uHvFelx+m5Et9ylMq2yHWUFs8/ACRtIzuhRXeQyHaB9ba\nfBdpq1hEvp8lAILe5haQDh0ZJtnp+0zBeMLIeIeRjJ2p/XXlOi810s6C88l+\nalZQ\r\n=uU+t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD0CaIQMfVvbASV4+qzOc0vu3eLuH6IHIKQfsYWRzEyFwIhAMrWFrwm6/XVKaK3RScsvWOhZbqoNnTgLCmZVnoP+qO5"}]},"maintainers":[{"name":"patrixr","email":"patrick@tronica.io"}],"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_1.0.3_1589785939111_0.26570758559046204"},"_hasShrinkwrap":false},"1.0.4":{"name":"strapi-middleware-cache","version":"1.0.4","description":"Cache strapi requests","main":"./lib","scripts":{"test":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","redis-lru":"^0.6.0"},"devDependencies":{"chai":"^4.2.0","koa":"^2.11.0","mocha":"^7.1.1","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2"},"gitHead":"67d8bf6569c76925306dcb2d177fd6ce9428aacb","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@1.0.4","_nodeVersion":"12.16.3","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Da/OzX48Cp0W4CFf5rRAGgmgH8RX1sf0mALlQr6HZq7UPRScsuAMOmdcwlzcXmHL4n3jdg/PKwx44vLQkra1SA==","shasum":"d8e5de7763517ca1d730e5e0496165e224460cb8","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-1.0.4.tgz","fileCount":13,"unpackedSize":15916,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJez30pCRA9TVsSAnZWagAANJIP/A9h6p6Obb3MboIqKYU3\n7lnqzg/0JPkOIed3snCULpI7gZHlwW0hqzdwwvIN/atV4zPT1s82QcersnDB\n8T9BdiWNnW6ZYxrIUwjYNYboMzAPT0JDIuQTGCw1UgAOr2TAuI0on09V5Jqu\nXTj0qR3ZGEK/FSTdpbQA5yINv58ThEybK1nzZKo0hbdFa95pi+Wg7HfonpAC\n7lAffjzUB+vEjuSQmp2IJynmEngBtiBB+u0zh9xB7EQ07xpkvHKjUnc5vpUF\nIvFFX0RQwO4It4xmYv9BYO6DipA39tTEhYtGS6roctvw9P4//rJsVfs/qUMi\nm1EBiZXKEGsDgmRtuKTb+0nIwdA+aqF9nzFNBily/mxoxN3KmYFO6KMn34ul\n7Dzhm+144Ouz5dnz3Uy7OIDemcE8LuW7Boeh76w5TT1W2+2YgNNUunoGo6Ox\nNzPkQppZXdKsTe3he+2Z7ZPCO2CyHmIwi+HQHfk5EDEbZh2ZqoamE02RPfV9\nHV1KLGUaYmvfBZ8ccGxE4Bc+isGCcm01OHBdmtu5IRsWCF66wSEUfMYC6ixT\n2CvVAQ6Nyo3Y8WGwUGPS4Yi6OoAhkTTCj4TqF9l/ii0aIx3lMcaIajJ2T74E\nBTo5Flp/7dR1A0Oi0bwJ4tjzxb/G2Tyy4ZcsVllIzr8JIzedlgUtBaxjybHs\nb+0h\r\n=YujG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHq+2QI8yXhBGPpeS8+VOQDXQ93wVg+tzwT4cDvC8oWsAiEArnsZmuNWT9jyz/IiyTbXSERQXV4KCyeQtVVZ/VWLVHY="}]},"maintainers":[{"name":"patrixr","email":"patrick@tronica.io"}],"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_1.0.4_1590656296842_0.1471055212094703"},"_hasShrinkwrap":false},"1.0.5":{"name":"strapi-middleware-cache","version":"1.0.5","description":"Cache strapi requests","main":"./lib","scripts":{"test":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","redis-lru":"^0.6.0"},"devDependencies":{"chai":"^4.2.0","koa":"^2.11.0","mocha":"^7.1.1","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2"},"gitHead":"3319ea09ad5ab15097e919dc98f5f7f931d17625","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@1.0.5","_nodeVersion":"12.16.3","_npmVersion":"6.14.4","dist":{"integrity":"sha512-6ERxOsPYPSlWqYzanZa57+PTljigy2mKMnfTlk6GyrAAXUG+lE3YttA5lw9cHIWrLl65dsLgDgBlrTX7Uhthyw==","shasum":"eb614ffd41320f034c9758a15aa8976a1e816324","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-1.0.5.tgz","fileCount":13,"unpackedSize":16631,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe3OSzCRA9TVsSAnZWagAAGs4P/3EVvDWSLPC2+vcTOVoh\nrLG4GMWl0z3jTY1WeUAezkGfzuhw33qeYn9QGDxKFr+1VUggrW2ODnhUukFt\nymv0Su+J01th3GIspty6EY21Ez954MosuJnrueNAiAWXcFS8Ocjsov0NqNw9\nvYtD9vscSLJPfUXbjpEg7AsZOdnjCy3mJN6XG4J7+3PJpjxaEtTGv0ij62mV\n2W74li5sITIwDQBRn0tvR6mLG2nGAGRt8tpwCvOwIv0l/iPY2zxYdTgGBsr3\ncuu/lC6SkcBMNkTeyJxKJdn3TulqYXQqXoT6BUKm3mHdP/fQMs2+uqkOJ782\n73kSJhWMRLebFjvfbzjzZNXB8fe67Qpa1A87lSbcdyKpHS+HpZf1xlvcdz64\nk0GPrOBCiBuw6qzi0yMy/5+1j1dNNV3a39BdtaWe5MnhaCPEvMFCdKeM9UFa\nd8cnIj7akMY+8KuPY8c7Xyyu2caGiSTPB3GGaLoO4oCLRVZ51jgI10wi/O7V\n5FIL6/BxEKOQFuOsdNR0D/ZTQYnFdbpPCEOEc/8x6w7T6rBfmnTmzpy25Cms\nq2ZMPPpjsEqwBqvP+NO7MXNhdQidmGRvTVszCe/Bp86w54DBvmbGuHUuAhte\nXRuQcxX/u1Ni7sUY8aiczDf2aZiQKcTcJfg8Bsk2VUmeMVFGIUwTswgFwjxq\nRuQw\r\n=x9Ll\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCHh1xe3aBLu5hDFyljEKUPrxv/unH6jYqC3xYq/8ff2QIgU1Q8tg7tX6y0RkQJwlSvAT5zjruy2wqpXNWQmpMj56Y="}]},"maintainers":[{"name":"patrixr","email":"patrick@tronica.io"}],"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_1.0.5_1591534770960_0.8511795922679026"},"_hasShrinkwrap":false},"1.0.6":{"name":"strapi-middleware-cache","version":"1.0.6","description":"Cache strapi requests","main":"./lib","scripts":{"test":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","pluralize":"^8.0.0","redis-lru":"^0.6.0"},"devDependencies":{"chai":"^4.2.0","koa":"^2.11.0","mocha":"^7.1.1","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2"},"gitHead":"85a045a7234fab25dc683f3cffe2b9bebffd4602","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@1.0.6","_nodeVersion":"12.18.1","_npmVersion":"6.14.5","dist":{"integrity":"sha512-S52ESTHL3wj3T3Cvkuf2fb2RfgCwlTAUCgo46nvLmTlgOyWqup8Y0G2usBfpeWyBLDy7gxjVssqb8P1H9PBq0Q==","shasum":"96590d4c5f9bf5fed590995ff5e0fedafa6f044f","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-1.0.6.tgz","fileCount":13,"unpackedSize":18113,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+YcCCRA9TVsSAnZWagAAAMQP/RhfXABnduukwgq4OL2a\nswvJUMGTe/58V/WNSBFSJkbtSfHgribv7C58uC8LwkdCOU3maOX4eZPMa4wL\nRKrdElsQz6zrQDIBB0K76lNDpF7NaYaEcOmmzpZHzusKpN6q6gGntTJ2rru3\nlb/VD+4ACy/W0cuILTaS+h/sQRKj2hIhSLtT6ebhZ6Ohv1mSy88om1x9G8NB\n3XpMJ+SqIYpjSldMQAjrdlaMJA5Q94T2oFAL9t4L1dzuL67kJl4Lw5Mo66vu\nacEWF0zTf1fYT7sxL70v5aJbdbni33mN5bwjSzrM8oiRUNhdVCgW45CLRu/d\nmZrX/GV8VcWVuXPYsu6UAH8jitFHsMm4O3jufpS2tKdqxOPe3AW9SMfAK1NU\nl5YcyBIqHIXX/rdn+kmOhy6nzdF3ek7P2qiszX3zDnrUGYVHGCJ7UdBNBH7R\nAjhHnHdItbj5Yax4nZh4ftrwC/R8dQKjoGYauiM8/ENQ+ycZBi+AupjXLdHe\nLTpctq5eZ7VoxusaCIiyLsvTl3imQSKjx52yGlrARY2io1HbuxwuhPOyLyER\nqxacHLdmcrsmRH31Q3Es6bEguR3TWopM9fmhdkXWCyYmGwd0YIPap6ATag2Z\n296xsToK/UFt1ammcHbUDqB+HC38V2iBP9NPL0gl/JKTQ/M5xZOUzuBg9VIA\n1EfE\r\n=+mfU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEto8jT+sRML1poIIYLhNKeBU1qoqN+wpqZFvjpon16+AiBl7SzhkKR0jucfGKa1512je1XNWOV1KTv5dadgA0s5Hg=="}]},"maintainers":[{"name":"patrixr","email":"patrick@tronica.io"}],"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_1.0.6_1593411330488_0.5677177453114484"},"_hasShrinkwrap":false},"1.0.7":{"name":"strapi-middleware-cache","version":"1.0.7","description":"Cache strapi requests","main":"./lib","scripts":{"test":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","pluralize":"^8.0.0","redis-lru":"^0.6.0"},"devDependencies":{"chai":"^4.2.0","koa":"^2.11.0","mocha":"^7.1.1","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2"},"gitHead":"9941371b14c04012deb8fd395aa08a35e69d54a5","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@1.0.7","_nodeVersion":"12.18.2","_npmVersion":"6.14.5","dist":{"integrity":"sha512-eThCZSskzTZeeoDP2rr5unuDaNi7XuhdMr4PBIf8N667VXqKUbbWiJz/GCRy2OWtpwfKAGLUtbC0hnzlxvW0wA==","shasum":"530a067343aac08492a0d2787be89bfd0c858e9a","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-1.0.7.tgz","fileCount":13,"unpackedSize":18113,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfH/52CRA9TVsSAnZWagAAOLoQAJ2+nTQ0+F7L/neVPL2C\npUrLDogkGSgWj8rrInR+g2eqnic7fhADoYoT3WcUVkYOLsvlUZrTNx+1ndW5\n6Yqsz3gVcAieoaCWeTLgE2KCnEHQaQBq/zMzF5YZfC2jZPhcYkw/5wf+sC3G\n4uUuDelh3eVSKRD8I0r8qeXVTLK4X3P1Rf+JY6Ox2hNhax9fnEljUX2LpoSc\nvLnTYasYWf5xfYMd4K/FA5ma36CPfeMbBGEA7oyyANlz27nPGqBzfT5MeF99\nmr9xNaxWZwn5uXNzbQgOI2Hfy1moE2bdk72VeUM26ivK/MtvvBRCfrUCfjLN\nMHnF3KMktqxd5uFIpyT9rd0htkKMySmJSOedC8nIR9b5QzcM86gthjtzIgEh\nDFAbBPpToz9T422XItQDGbHymjid9H0xPz5hUwUieK5UBifd5NKQ+UfGio2p\ncLhuY5UpxNSQIWa1GIOQKDRr8q0wFwCHc0YJnAy385zfjwXI6S53164KmEaq\n5GgvDAgULbQ/YxK+fjRyVuRHSWoX9SQ/5pxQ8UGZ5M1WrDsu5ZELKBhvU82w\nesJhFmV3gkSJ2mkrlhTY5MhPEzYiZcsE8YzqkX6C70VebNA1aJ4/KBK1bvSN\ni5QxkwhAQ0HKc/8xvneTofcTzJsc9TPp2GJeNeXuNC56yBlCtIu30JmJAL7v\nooHV\r\n=lu5F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICNyQwiEGr5JXNR4nhI7De4TWGToxltLdi2idN+bFQICAiA5dXgqDptdmnNFele5Y8/xL59hHH/YJH/0XTcQRAl9jA=="}]},"maintainers":[{"name":"patrixr","email":"patrick@tronica.io"}],"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_1.0.7_1595932277651_0.9159972162108092"},"_hasShrinkwrap":false},"1.0.8":{"name":"strapi-middleware-cache","version":"1.0.8","description":"Cache strapi requests","main":"./lib","scripts":{"test":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","pluralize":"^8.0.0","redis-lru":"^0.6.0"},"devDependencies":{"chai":"^4.2.0","koa":"^2.11.0","mocha":"^7.1.1","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2"},"gitHead":"e4c3b87f24d44ef90188f22d2eb082f918e788ec","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@1.0.8","_nodeVersion":"12.18.3","_npmVersion":"6.14.6","dist":{"integrity":"sha512-AVEfP5uw8tqV4GF1TvzMotqqUTHGOQ1IwRAvC6Vpo/4/z+8o20i4NtW9OazxEhlvDO46XhJEh6uUr27gO6rjWw==","shasum":"3420f1ca0692751d92f772bf62fd35a44a2ed625","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-1.0.8.tgz","fileCount":13,"unpackedSize":19415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPyAmCRA9TVsSAnZWagAAlSsQAKUsEisS0ae8imy7JKkG\n7XVwudHV67xaFV0tD7uF/dJ02Bsyhh/X2UM3p6mY++ZTQ9i6U0NF64g3DLTI\ntLsWn6HEKD13HqCpypaHvlDQnavb4QC28Us9CPKyxrIasiUd3u9L+H80y2lG\nVxnvDf0JbX3ofoaATNUgiUF/PTF9m5tJgxGJAIu6eBZyXyIXhrg1dDLwEB6j\nFC811rvyWxweISk0TO/dn6Jhf7zfFcgebeCURR5eJ9cefJYOqxjKJNvbsovD\nhIgewMDiAiRCLUb7IjJKj+h01gDVhFBLdQAQXIlUARdkj+yU+r4/PrZ9Ul2B\n8SFuAOqCVTqGk5nwcplJkRGNZpgTadPEjzS5tha7fJrOVxTWgH4ohjXpO/aB\nyip508ipq5o4dG3CsCSt+oIyQQpkJwqch005z9DzM6KBIHG2EPmdRA3BAX+4\nNUV4gmmhPJEkrdjVXvBDFlVmuCTd4QZxFGs61StIQs0qjvnA3jXfl+KQXYeJ\nlOlfOg32tabk3SOETdZ6dqXMdxw/TfNiDFBiuzVKSVrkxo5jYBhoD0Wv7Tb5\n/qWJq8rdjHz9ImvrO/Ay+zHqcNu2NBJEd6RBJW+yyENnCQCFQu92JwEiqhGb\nIHrjqVF+mGx4nH7rRk+vcPiq2Iq4GUpK+c902GHq5E1MNkCYpy+5Xgf9fHXE\nO7qb\r\n=BfBy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCyPPDmh+nT+2u7AowINbq4z45nYsANgt55931j9GNhsgIhAMkxEU7ADqn9rwUi9QTkod7Rwx8Z1PyXO2O5bxpabwpJ"}]},"maintainers":[{"name":"patrixr","email":"patrick@tronica.io"}],"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_1.0.8_1597972518534_0.8660361933457452"},"_hasShrinkwrap":false},"1.0.9":{"name":"strapi-middleware-cache","version":"1.0.9","description":"Cache strapi requests","main":"./lib","scripts":{"test":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","pluralize":"^8.0.0","redis-lru":"^0.6.0"},"devDependencies":{"chai":"^4.2.0","koa":"^2.11.0","mocha":"^7.1.1","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2"},"gitHead":"643699e0ff72a44c42b2035c694a38093a01e02d","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@1.0.9","_nodeVersion":"12.18.4","_npmVersion":"6.14.6","dist":{"integrity":"sha512-5NPyjyvAa9Mu1VuVg3aCwr1hAfvFe5R+6vqCwKSskUt+N4R8gRqqXg+VUVDeRGdMQ+QtGS7tGTyedMKPnuATEQ==","shasum":"25321155a1bea0ba3a65b52a86930e6e08e679fe","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-1.0.9.tgz","fileCount":13,"unpackedSize":23142,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfeoOtCRA9TVsSAnZWagAAgIUP/1E1gRek1oTDyA2lplfu\nz94NglxtAAV8UxkB/K2fyVWFLEzuRiVLMSBt3DQivafO+VApIz/ZtXaQGIQF\nZmzLzJhuz8d6DzapoBDa0Xjfz2zzOB+5KcV51Jp6ydHjF9bR1X0t/oXGxfcl\nc/RxU+KSA9IKwzC4ut0k3Tah3Ko3RtljizwowCIv3XbG9eE4/HfX1mVvasNG\nQT0Gqbg45TIrYYJhcG5FOPCKzUruSfswWRBG5oxmn2BG6Yu0qKuijKkVLm4T\n/5HhF2wAglam7nylRMx2Y1QZHZ5czBi9cmMyhzWHp4wXwkkYF8PtqpRf5xpN\nKcousuEKtgkImuB0s8EJxTo8q97cuy+x6bNvHSLjuPz5rFA7G4G44Vcl+2NB\nCFvR+5CKupTkqZgWmKWVgnAZejv6JpFXIT/tYgjTihWUff9QEGUqHdIjA/C6\nQJtqzw+qWCvDvRxKY9ARYcxOF2cXi6NEg7Hd0X3Ecd5JZuNYuab5FEXMca9t\nAY4yZd8HQF9bLmWxYZ3nqFlRTBdqMygcrNeI6l6KJy+BJgxqG8Q5OGFBP8qo\naTKneYM1ji49R5lF52HT3qcLXvClp10bwh+gLcMdr/r0yj/m/ecUnUfX8q/j\n+NRdOhQWcta4Hwut3UcZ/Kglp5ZLRu+OrbZzism6dhce44gJr4XHuqS7r1qr\nfceY\r\n=kk4y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBKHab5sBxEbwCj6w5cXUq3mDYFianA5uCMUyepZjU/1AiAhYDB0s9TmD9fhjFbrMF1grD2DE5uSe9cSOpAauhOH6g=="}]},"maintainers":[{"name":"patrixr","email":"patrick.rabier@gmail.com"}],"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_1.0.9_1601864620885_0.32537325607505196"},"_hasShrinkwrap":false},"1.0.10":{"name":"strapi-middleware-cache","version":"1.0.10","description":"Cache strapi requests","main":"./lib","scripts":{"test":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","pluralize":"^8.0.0","redis-lru":"^0.6.0"},"devDependencies":{"chai":"^4.2.0","koa":"^2.11.0","mocha":"^7.1.1","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2"},"gitHead":"9dac9da3f73f84d60a1a8151cbf376b623fbef8a","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@1.0.10","_nodeVersion":"12.18.4","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Z0nCf+ufzEKq6mX4F2NyMABLUZWfvuOatBc2V2bwrin+yHbzOOG8Kgk9ZR4eGtftzAhHpQAluU7fwWgXYJJmRg==","shasum":"cf624075c09d1ec370acee8d57f01ef19f2e53be","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-1.0.10.tgz","fileCount":13,"unpackedSize":23231,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhpz4CRA9TVsSAnZWagAA3BQP/25kaagy6IwWoulkMwVO\noO8oJjlYy1eNzFJAfNxpu+2AcMZVW8GOZ/slLWp+n+GsuIGI3AzUk4tCAMYB\nTO/z3Wr6726dL6yVsMVilQLYVMdHLwKRW7uxcRmWF6pSEGx4Mbn340Z6iPnf\nm0JouiCLc2D1egmT6W6ZzFm5o4oOn9jrWCN+TkWhK1VcbJ28ZCSRf9d5vE6W\nHOcU/G+GVqAjsZomajR6Ervm0o9BPIdZ7qHuh3geoH/ZMgEoWEEQ+irY4yPD\nqP8cbpJ3eCOX/lTFstSI166SWGEX5ExFgpvA7pryWvev/LNgglMI+ZI1f9nw\nUJL+t7zhGNC/Xtk55uPE6BtX61+r/+q5T1sGo1TBnmCP4svYuwX5N2sDV01h\nBqRl7Gmr6owftiV4HzmX8qsTfPIcbqA9z4oVBV4zVaJnfaP/yN2u+vZjcE3F\nCYJQxQxNp7TBEa9TWZIKT2+snkwovlzGLeRyzbESlVE6bRrZ3Z2/yYmBuWwG\nbptgXP+bnHML2EdclO2aTXNtKEA72edB1t/3SBwfSwItQgyeM67wuyECgE87\nxzbm6Pb9GxRHBM+8Df9qIA4mKMeEx86RlPANDbESmD6GG8WXTKCnpWopLp+0\n4msvn2R7xo6LjMZ9N9pXf2YKPsha9meVDWC4MuubPo8lBq7Q53KaHD1aRv5F\nwuP/\r\n=7jke\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDcJZOuKE/xc4Cd5KRPVHR6NTMRj0zKNTKsvn0AlMkArAiBqvyxbLlaSUjo3TwHIldD8kgfcqpN9CxZPpRoN2/Qcpw=="}]},"maintainers":[{"name":"patrixr","email":"patrick.rabier@gmail.com"}],"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_1.0.10_1602657528263_0.2481716650940924"},"_hasShrinkwrap":false},"1.0.11":{"name":"strapi-middleware-cache","version":"1.0.11","description":"Cache strapi requests","main":"./lib","scripts":{"test":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","pluralize":"^8.0.0","redis-lru":"^0.6.0"},"devDependencies":{"chai":"^4.2.0","koa":"^2.11.0","mocha":"^7.1.1","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2"},"gitHead":"9fa09f641e6eb2f850805ace27322be62e411af2","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@1.0.11","_nodeVersion":"12.19.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-cN/emHGdnkr2kbNDNqjtjAfJVnOyHyHmGYSfobx2qBSX2+xANx5ROHXSBXVUalfO0FlvThkzni3BwiQ6SpGkCQ==","shasum":"20315c7308bff4850dc56f296f640dc3ff5c4f53","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-1.0.11.tgz","fileCount":13,"unpackedSize":24080,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfsf2FCRA9TVsSAnZWagAAWWAP/2wMe6A+dTBtJhED7/vx\nOAxaZPw1/LnXu/lHlZxql2PRW7+QBIXm5612juMFTqDX7yHwRUjX4dL8CIfN\nPrjuMvaIWSoHW2JCTgd3q4RtFX1BrYSnogiebgIX4X/OpnCtwAaY0d8ahR22\nSBz+O68iJOtWr01gatCKW9FWbgtxP4YypZLX4MdW/cWjbqiODUEtzOI4YB/g\nKF1/HjVcno7KrX6CVF55BpEiO02JLydqEt5wZs5sGylCk89P9sIlBxlVBnfN\n63T8V1uV3AsdISpwR1NCUTsxcEbMnMejMNQWhqRvl7G3E2oI1JLvhFCZktd+\nvFGMswiMlGFvg+uaTolO1XPYeFaOa955XaHBjsUNmkQZD9yOTkNal5Qcxw0P\nxI7KJRcD02wQhQgsRUIlivx92cHo/BwNlBrONlGaFz7L6NtT2iUvpElzKe9z\ni72L08k8WAXg119XivVnEOVRqhw7JN+z0Uig1mb3gYOr9NXLlteeL1VLv5J4\nrelXY/FqHWWrfolCbAWtHRnjFx3SN7yPbae/27hF3EVAA5YYQ7qQhj9maxfY\nw1XQj6dhDvppg4Vg8Yz1bd7LvB8CA00Iq9MK6XkjahoHUqikHoQ9xUT3C+J8\nBh1nfaJq/cq4eOPhPWk3QJp/EiaJpqnIc6EEM5sPbhXhNxjwB6/t9mEonm5Q\nfgeM\r\n=S1cf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA/olwklfctRatdQ+KSZ/+4ZsiRTkXstSiAatneIGXvbAiAOwb1yK058dfII1I0eJfTt4xhXCu3iCvahUhW29ToJxw=="}]},"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"maintainers":[{"name":"patrixr","email":"patrick.rabier@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_1.0.11_1605500292579_0.46333828143746447"},"_hasShrinkwrap":false},"1.1.0":{"name":"strapi-middleware-cache","version":"1.1.0","description":"Cache strapi requests","main":"./lib","scripts":{"test":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","pluralize":"^8.0.0","redis-lru":"^0.6.0"},"devDependencies":{"chai":"^4.2.0","koa":"^2.11.0","mocha":"^7.1.1","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2"},"gitHead":"b8c1e7bd5b149e52cfe15fc3cea0d49b68c47e2f","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@1.1.0","_nodeVersion":"12.19.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-IImZoboTgXObgolK18sePZ2o+3a9uO5Fhn3N2HifKoLfn2dkHcSL219XVCGsntCziiqYQW8kRsGfNeBn8uGCCg==","shasum":"6b5c72e9adf18eadc8c32d4b903ab5a483827242","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-1.1.0.tgz","fileCount":13,"unpackedSize":27564,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfv2jPCRA9TVsSAnZWagAA71AQAJ6/4Q5CfwSE9xP4yEnn\nfVmuO9ulkNorWbekK3NgrSw/vueKkgPdOTUY/wn2b2AcXECYwCLF+bxWZxga\nLOhTqTyKk83LISi6S+XSwqULhZ4P36G53F0dhJYzg9W+p4Q2UDXQ9vAAIl0q\nkE89T21PDG8yasJM+gIgWhR0oRreeNmzQGJb8yexM7VFMWL7d54egO11MnLj\nXhBtIHCBJtqTaj5PD2edLROCGHTFbA5sSe2PrWdyJfXl+Z5XJm/ziN/g5r4I\nIbzELOQMl8ExVPl5dMym3l2MiyrHw82umdUPXDE+BRxdNNO61xO2LF2nacuq\nDxuR1aDDWGwkWoy+TBQO5pQKP57Ed1TaHgLTwGcaIYserHC45QeA3yXFnQ8w\n3yOJyYKCkeZ7Keo9cwbDoO7acPecV9viKAepZb8ALY6tFDKZSeaGaA1gBMB3\n9NMy+QonUJO7jbomNUOe9zJXVQEoY/KnaWC+T9gDslQf16Vh3qHZ1ZjasK0S\nmB6HHK2k+I02v90TX7baWHrYHygz1HOosLfy+TpbAVcE2tXkHuxgUXAOWZiI\nY8ZEh8honN+HYWRyzA5UZwiSQYWmwXGPhyaz5VJoxJKMGzbAIbpep0+TeiAw\nvlHJ0AUEc5pc+9okY1kDtULr9BE1+kdL1w2vwJwVpR5wYMcQ5daMZdWqTMYa\nc/Pp\r\n=XNBj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCby4J2hdsweNCSHp4zf54FZ3JCWb+WvJ8tNs7GudPcIAIgD+fIwBkZuF/9GLoTma2VMJqNq7vx4ajRRVL0iRHJYtY="}]},"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"maintainers":[{"name":"patrixr","email":"patrick.rabier@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_1.1.0_1606379727459_0.1759321700230585"},"_hasShrinkwrap":false},"1.1.1":{"name":"strapi-middleware-cache","version":"1.1.1","description":"Cache strapi requests","main":"./lib","scripts":{"test":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","pluralize":"^8.0.0","redis-lru":"^0.6.0"},"devDependencies":{"chai":"^4.2.0","koa":"^2.11.0","mocha":"^7.1.1","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2"},"gitHead":"300b16aff5b6c286cf6b590a64e7afb66875b14d","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@1.1.1","_nodeVersion":"12.20.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-dfCvnP9IgMDMk7bDT/EjMxpVlerIDWiEKb5mkp2dSFXIp8axNU0vV65GZzdiZcuCXxuz7e+vHuym6RH1QnS7yg==","shasum":"aca56601a8cd853d8435e9cd3dd7f32b672a972d","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-1.1.1.tgz","fileCount":13,"unpackedSize":27580,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0T/0CRA9TVsSAnZWagAAeyMP/RVD/rup5kXUv0PyQD6y\nlaOHL8555H6MJ6o8mrnOkH5e+P1XI17KyjVQDfenKZpkw0D8scY1P67lI51m\nW94Xamgya55hSjYJWwmpGDWOP3Njd53VAz/ScTsx4NXHdqRI15vc8CnY01I/\nwNsQ9rr97IMNG4WOHPt5nhcfNqP73B+/sWgi+/AEYGojCrvkFPJLZfy+553P\nmQKTtr3zZBEDHsL4P1deMF+rYGLB0OMSOriQbuLEbImUg1Hu4YKWk484IoDI\n6Wowa75Gf8yOElQJopinkE7tzi9K3pQRsfwzn6+JNIsyrdCL38uNdZMAyp5L\nLemIdIsUfvMwaQQ+EE6ixtozfAijaZan4PkawXE96fz27I8JkiLQ7U4F/UiP\nsIwnSP3+sH5F65/rvsJWTKiitwLfj5Woj5T3JxJCSI183xzvAcizb9L3fLaD\nZPpgCRw9EZcqi7DzXiGZEE0B0smaNghTmxr4qQLfvvzS2Xqgrs1TxZWXrWBw\nOuZ34hO4MHgkX9RzX6+8oFFjluaEi2CN8qQ3BrCZeHNMXmX5flca7BiYGwY2\n9AFzmJdVFV2eGe1RSgq5nIBzQhT8G9uU4TI3aGKxSfE+pT8HSPN5uK0uFvJP\nUO59PbOq8f/7REv8aVQ0Za+IGKJyFN7uu7R5ASmqB3lGsjsS8fWcHGvFNrIj\nwsgp\r\n=Fzjm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDnv2Uugt9tiAWaIAU37oBXSqiF70iLdLFPooL6m5NDiAIgbqSPBO056YRpwcejl6mDsKgCVbSEkJbXQLb6Du7WMqA="}]},"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"maintainers":[{"name":"patrixr","email":"patrick.rabier@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_1.1.1_1607548915859_0.5026415175910235"},"_hasShrinkwrap":false},"1.2.0":{"name":"strapi-middleware-cache","version":"1.2.0","description":"Cache strapi requests","main":"./lib","scripts":{"test":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","pluralize":"^8.0.0","redis-lru":"^0.6.0"},"devDependencies":{"chai":"^4.2.0","koa":"^2.11.0","mocha":"^7.1.1","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2"},"gitHead":"fc56ea1bff1ba46cd68638ef12f08b858d10a900","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@1.2.0","_nodeVersion":"12.20.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-cURKzfdTO5lIpFt8DPCdhZHYawf6IQkaejUKLb4aqnZILdGu6p5Hpu3sCWcEX8dr3XwxvUoavr6avTssTkQu1Q==","shasum":"9016f95236d89b118004720f6a65398cc75da336","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-1.2.0.tgz","fileCount":13,"unpackedSize":29128,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf6wJ9CRA9TVsSAnZWagAAlNMP/jY+HurlwoY9jAeIAMGU\nDcPN3lKfrTYZKKzCFaozQesHtcUdQ8B+eEFdu/oSwLycEfUCTXshiW+e2sKa\noZ8v2wpl4JdJgV81R/hyJXv+Zr/nmf8e+X4sH21t79axE4bP67afixpfXS1g\nb3qTRDVz/GwitkHof5zb2X/JHMvsA/LKSn/zmO+YF+MTQnVBn9O2J/U9UXXQ\n//XZl+UuWC8lRetZkUut3Dn5ItLeBD/P9zLVGN/mWklsqUAuBitbuT20PLef\nXUyyKzXnrpIn1N85KJPW20C+zEoaQon0liTDz/YVnVUiOLiaf5JkLJDPvTx6\nXBc6gQPh55HX5crS05Q0ai7qkY6BVsQQfyk9vZX1BlYDyCbLCp/VHL0Ubtg+\n0KxIO8RuaJ4VhgzFfQJEgbB73aCOMTfxASk1TOkz1a70mZzAasPpze5QrPmv\nmH3kw6uVRvU8CNVWARd6tMYIMyg/0IZVYTEIRFq87UyIDv6ds8vDP4D4lEFA\ntMfrvAYfAcrtDQjOJaInjSTTHL3AYkX2j3nSWJ4f/YzJoku6oiJiiWVAchWD\niZMU+FGshMSKjN24WIrhIMjhlCk01xVm3ETJ+hy/rl3HiqyikmGUMm41ygpX\nhJPxW3+0I+Z+frKAeyeG9lRSkxAMSqtZr27nPgQIPhvP6z2GxDqw/vYLu2Du\nSp4i\r\n=y73m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFntYTGAfJ/nvsXbuQVcVeBPpp712+bh0l1bydUXKIGAIhAPQmBQ/RYTxyzK6xVKkRJsD0BrRBcLyU9qNnY/KfRMhN"}]},"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"maintainers":[{"name":"patrixr","email":"patrick.rabier@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_1.2.0_1609237117383_0.0752601933876953"},"_hasShrinkwrap":false},"1.3.0":{"name":"strapi-middleware-cache","version":"1.3.0","description":"Cache strapi requests","main":"./lib","scripts":{"test":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","pluralize":"^8.0.0","redis-lru":"^0.6.0"},"devDependencies":{"chai":"^4.2.0","koa":"^2.11.0","mocha":"^7.1.1","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2"},"gitHead":"9737776ddcbe2b038a2cf6f1effa359ecd4a13a3","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@1.3.0","_nodeVersion":"12.20.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-yaIIczEtRGuwnAWTCR1c8s8yrDoaoaKZG5JPnB5PAB0gwBNWwRYPHfayMPNmtspImwRugWF8JN5G69Tq/Hc0Cw==","shasum":"830bbb6ad81fc3f2280e251166b7d2ae395cf9ab","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-1.3.0.tgz","fileCount":13,"unpackedSize":32190,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgD34OCRA9TVsSAnZWagAAXuAQAIAbx1LFB2772es+1pg3\ncb6Qfa5yPmKsXoADRFoxCPR3ZDqLkPCjUgCoWQHGZE+/xFzFjY25TO5DXnpg\nnO/kRYH+rCh5rDnMsGCok/UERaq06uQAQGPJZAUHrW9dprIx1GSPxjbNwfkN\nZX14OuWqEKyrJstZeMTJebKX2ipuLZurRU9IQj3yrTZp2PfVFByZ66+4Hpiu\ngjHZSsnayDc1LqHiw2K9tp+OoH3IXYL/ZXccPspZQtBdiS+BzgQ87GAeoMXW\n70Rh+qMF7f8yMKf4CDRIPWDMJnsNO7tSyXDh+N4BXwEb5tywsIaEiQRZtbTl\nzjlD7i7VpNX/qaaZW5g9id7jhE1f4ukGt3yESSRsIKsdN7d4tjKDlcNk1Hhe\n+qwou6A2mjt07seQJm1goo/kPHJ6xJ2f6mL6kMKJWHjz4m8MdCgvAVioj9oo\nrcA77VEXnFnb5UBVLJU2E7ccZrdwGdHZmg8ImtrmVVwEReuTXKe0vEKHvqeb\nXzVUCrYwgRMYXzd3RHBkB+5VcMs1Sqz/ca9RL36IFKL9zF+DwcCES1JIln27\nWU6oBAjxp760SUJw/mHGgK0i+8xRcJ56I3RCzwN0MuTuwGCMF58kcaaxJh2i\nIjflLOgZhl6an8b/vTO3uzH8Zy3KwJNTd8SncgmWghrjHFjzgyShQ5Zrj9Lw\nGxRn\r\n=OgRW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC/yfDTBKp1yEtaDvBsw60McnfedJWbJ2B5IR/v3yZA/AiEAhcL8ZxxIyxUuX4Eb2CFWSFldDIPRAmbq/jB7Td+sjHc="}]},"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"maintainers":[{"name":"patrixr","email":"patrick.rabier@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_1.3.0_1611628046371_0.23849550396471786"},"_hasShrinkwrap":false},"1.4.0":{"name":"strapi-middleware-cache","version":"1.4.0","description":"Cache strapi requests","main":"./lib","scripts":{"test":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","pluralize":"^8.0.0","redis-lru":"^0.6.0"},"devDependencies":{"chai":"^4.2.0","koa":"^2.11.0","mocha":"^7.1.1","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2"},"gitHead":"81f2ced91f02838c9756db42e0f76843e5d39b5e","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@1.4.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-wNXPAwrKI0UYwRM5oPkapB0ZiGrsTmPIsa5khK4bbb+c0nh71s8Q6U+go90nS5cPMfgYzM9HgLdUAcOeckEWFg==","shasum":"e80a40a24c607cd5688ebac9a673bce18bec64c0","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-1.4.0.tgz","fileCount":13,"unpackedSize":39584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgE5RlCRA9TVsSAnZWagAA5eQQAKOuVMvJyxLiWJvUDC2J\nY89GqQxqydhVI1u18ed8MgUN9I87ed8q4mLGBaTkcSl0yssDN+Ub68kvi1JS\nfBKKTf4LjjEZopIqETQmI79o4KqlPwrxRrvg+CCenfeIul/xNxGD+f0xmgGv\n00YRwLrlyCQaF3poFhPD8C93JvQ0SuA03gnEjxocWsISyCSovyg6cgkjSdBD\nindtA9Dtp0MCrFJCcLWBngfXvAN/1028d8U/p+CbWMTs4j8S6pwZ4ztdL0ll\nz8W+b4oHU+gXkc7NMCEsIR6bIKiy9Mpj3+z70Kn41chpL8qspMy5rJ9sSm7x\ncX0QF9ct3DQtJE7lHzz6QA25QdmpSKBmV+jG322yIfPRKj/91i/4ISs+KLCA\nUk+i96M3xt6RCv5QFY3iWXpYTW0vpsiaauWs0yDVMDkidbaMSb/DEe6+Z5ZQ\nQHeRG3Jcyv7GG/H8PuxmLTmgOrZpi035j13l3qSpjYwCeojzXovmghEa/ooh\n8r+/4ajz/Mpk15DfvAGU9ZEK24L5si/BglaEWLtXILOsCPrey7/3OE/hewAF\nQPYs/FlFvvCYcV0nxOcfRE1UmR+DSRAz9o2oPN6ywc/qcf2yoJJUNaajNo4X\ncIAM3A0nPgbPw3qTFdnj3lVm08c/MD2NVDI+b0Po+ocSs+rIMQLUc+Vaeusl\nD391\r\n=dt9i\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG1CgJ2nX/M+eEyh+xlZlDn9xHmJkBiWLodTJA4gMNeRAiEArd+5p8ThzGTw+I0D8GL8p782CMsyTfb8khUj1gFXaks="}]},"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"maintainers":[{"name":"patrixr","email":"patrick.rabier@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_1.4.0_1611895908651_0.09229126383977704"},"_hasShrinkwrap":false},"1.4.1":{"name":"strapi-middleware-cache","version":"1.4.1","description":"Cache strapi requests","main":"./lib","scripts":{"test":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","pluralize":"^8.0.0","redis-lru":"^0.6.0","semver":"^7.3.4"},"devDependencies":{"chai":"^4.2.0","koa":"^2.11.0","mocha":"^7.1.1","sinon":"^9.2.4","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2"},"gitHead":"b32979ab03d52699b47888e996aaf54918d6fcde","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@1.4.1","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-etAM2Oz+eqvfl24Lp+geabH1pxCtx922iawdyGCKcG8YFVAi1WLaaD6jK6D2hWoVxGBTVJydu2j9F3nVm9RaJA==","shasum":"6d3a6f7aed8a1527fe3a8b763e6beb907e79066d","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-1.4.1.tgz","fileCount":13,"unpackedSize":40400,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgG6HgCRA9TVsSAnZWagAAHl0QAIESLcrVcNXAZMSRIkid\ntSyI5gnZtiozSalEDSjSaaAjp7n/b7SbJQ0TSnt/PMv+VRDqrca8oY7oJ3W6\n9SiyWRc9rUE3jq093GH3dY4WLE0PHCwOmKO29yY0H/xyJhxvZZFWpMO5n9JR\npwVFUhMUtqbukNz6zXfa5Vs1D7AfQoQAOxprS7NFcvtRP43+idDBt/CBoykD\nX5EYv5gOg+Q/7x3BNk38eecxsZupzKIeonk5oxonYXnSBHJOy+/pKLpimJmT\nubXOs7QXj+falN5j3Ty7vzJegmq0chH/D43jioi3uJ/RyktKW9xqtNO57iwV\np+8m3n3Qu2j5SGlOVkpffGmrfA71ba0JgYXHu2uoXWS5WJDMkskTw0lvx2pd\nw/h0kcONzi+qrvRtiuUQUjzdMTc541vo4jeAdyaLHfsJD2/7/n/SJj5YSAbw\nMnlp3yECegoyeAwlG6jjWM4gbt0NcFezO2MWDSigUmNfMLXzsWRIUVH7zS+i\naEFwuNIe0gUgvKU17BxLd+azGFHaRSqUmFVX2hQlt2k8FOlTv1HdOb074rO2\n9J+ja/7HGWdS03MuVsSdIRJfGbIZqbcTUKwF12UV4GQRkHL7NuTnVP2YPRxo\n+oW4vSoDdHRuFiR7mefYkuZskFCid2HTVHkEP90DpdkK8QsPHyVRuNhSUYCt\n+S8y\r\n=DIsX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDymO1L6/wqx3TR4UsaRt9cuWrvGmdOxAeLuxFe8NQdlAiBJO4mJLfJo+m53x4uvaknJcxC2LuyorBt4BcBsqO/uxg=="}]},"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"maintainers":[{"name":"patrixr","email":"patrick.rabier@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_1.4.1_1612423647254_0.43689861666554464"},"_hasShrinkwrap":false},"1.5.0-beta.0":{"name":"strapi-middleware-cache","version":"1.5.0-beta.0","description":"Cache strapi requests","main":"./lib","scripts":{"test":"mocha ./tests/*.test.js --exit --bail"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","pluralize":"^8.0.0","redis-lru":"^0.6.0","semver":"^7.3.4"},"devDependencies":{"chai":"^4.2.0","koa":"^2.11.0","mocha":"^7.1.1","sinon":"^9.2.4","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2"},"readme":"# Strapi LRU Caching middleware\n\nA cache middleware for the headless CMS strapi.io\n\n![](https://github.com/patrixr/strapi-middleware-cache/workflows/Tests/badge.svg)\n![Maintenance](https://img.shields.io/badge/Maintenance%20-Actively%20Maintained-green.svg)\n\n## How it works\n\nThis middleware caches incoming `GET` requests on the strapi API, based on query params and model ID.\nThe cache is automatically busted everytime a `PUT`, `POST`, or `DELETE` request comes in.\n\nSupported storage engines\n\n- Memory _(default)_\n- Redis\n\nImportant: Caching must be explicitely enabled **per model**\n\n## Installing\n\nUsing npm\n\n```bash\nnpm install --save strapi-middleware-cache\n```\n\nUsing yarn\n\n```bash\nyarn add strapi-middleware-cache\n```\n\n## Setup\n\nFor Strapi stable versions, add a `middleware.js` file within your config folder\n\ne.g\n\n```bash\ntouch config/middleware.js\n```\n\nTo use different settings per environment, see the [Strapi docs for environments](https://strapi.io/documentation/v3.x/concepts/configurations.html#environments).\n\nYou can parse environment variables for the config here as well if you wish to, please see the [Strapi docs for environment variables](https://strapi.io/documentation/v3.x/concepts/configurations.html#environment-variables).\n\nEnable the cache middleware by adding the following snippet to an empty middleware file or simply add in the settings from the below example:\n\n```javascript\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n    }\n  }\n});\n```\n\nStarting the CMS should now log the following\n\n```\n$ strapi develop\n[2020-04-14T11:12:41.648Z] debug [Cache] Mounting LRU cache middleware\n[2020-04-14T11:12:41.648Z] debug [Cache] Storage engine: mem\n```\n\n## Configure models\n\nThe middleware will only cache models which have been explicitely enabled.\nAdd a list of models to enable to the module's configuration object.\n\ne.g\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      models: ['posts'],\n    }\n  }\n});\n```\n\nStarting the CMS should now log the following\n\n```\n$ strapi develop\n[2020-04-14T11:12:41.648Z] debug [Cache] Mounting LRU cache middleware\n[2020-04-14T11:12:41.648Z] debug [Cache] Storage engine: mem\n[2020-04-14T11:12:41.653Z] debug [Cache] Caching route /posts/:id* [maxAge=3600000]\n```\n\n## Configure the storage engine\n\nThe module's configuration object supports the following properties\n\n| Property                   | Default | Description                                                                           |\n| -------------------------- | ------- | ------------------------------------------------------------------------------------- |\n| type                       | mem     | The type of storage engine to use (`mem` or `redis`)                                  |\n| max                        | 500     | Max number of entries in the cache                                                    |\n| maxAge                     | 3600000 | Time in milliseconds after which a cache entry is invalidated                         |\n| cacheTimeout               | 500     | Time in milliseconds after which a cache request is timed out                         |\n| enableEtagSupport.         | false   | If set to true, will support [etag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) in headers                                   |\n| logs                       | true    | Setting it to false will disable any console output                                   |\n| populateContext            | false   | Setting it to true will inject a cache entry point into the Koa context               |\n| redisConfig _(redis only)_ | {}      | The redis config object passed on to [ioredis](https://www.npmjs.com/package/ioredis) |\n\n### Example\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      type: 'redis',\n      maxAge: 3600000,\n      models: ['posts'],\n      redisConfig: {\n        sentinels: [\n          { host: '192.168.10.41', port: 26379 },\n          { host: '192.168.10.42', port: 26379 },\n          { host: '192.168.10.43', port: 26379 },\n        ],\n        name: 'redis-primary',\n      }\n    }\n  }\n});\n```\n\nRunning the CMS will output the following\n\n```\n$ strapi develop\n[2020-04-14T11:31:05.751Z] debug [Cache] Mounting LRU cache middleware\n[2020-04-14T11:31:05.752Z] debug [Cache] Storage engine: redis\n[2020-04-14T11:31:05.784Z] debug [Cache] Caching route /listings/:id* [maxAge=3600000]\n[2020-04-14T11:31:06.076Z] debug [Cache] Redis connection established\n```\n\n## Per-Model Configuration\n\nEach route can hold its own configuration object for more granular control. This can be done simply\nby replacing the model strings in the list by object.\n\nOn which you can set:\n- Its own custom `maxAge`\n- Headers to include in the cache-key (e.g the body may differ depending on the language requested)\n\ne.g\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      type: 'redis',\n      maxAge: 3600000,\n      models: [\n        {\n          model: 'listings',\n          maxAge: 1000000,\n        },\n        {\n          model: 'account',\n          headers: ['accept-language']\n        }\n      ]\n    }\n  }\n});\n```\n\nRunning the CMS should now show the following\n\n```\n$ strapi develop\n[2020-04-14T11:37:16.510Z] debug [Cache] Mounting LRU cache middleware\n[2020-04-14T11:37:16.511Z] debug [Cache] Storage engine: redis\n[2020-04-14T11:37:16.600Z] debug [Cache] Caching route /listings/:id* [maxAge=1000000]\n[2020-04-14T11:37:16.946Z] debug [Cache] Redis connection established\n```\n\n## Pluralization and Single types\n\nBy default, the middleware assumes that the specified models are collections. Meaning that having `'post'` or `'posts'` in your configuration will result in the `/posts/*` being cached. Pluralization is applied in order to match the Strapi generated endpoints.\n\nThat behaviour is however not desired for [single types](https://strapi.io/blog/beta-19-single-types-uid-field) such as `homepage` which should remain singular in the endpoint (`/homepage`)\n\nYou can mark a specific model as being a single type by using the `singleType` boolean field on model configurations\n\ne.g\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      models: [\n        {\n          model: 'homepage',\n          singleType: true,\n        }\n      ]\n    }\n  }\n});\n```\n\n## Etag support\n\nBy setting the `enableEtagSupport` to `true`, the middleware will automatically create an Etag for each payload it caches.\n\nFurther requests sent with the `If-None-Match` header will be returned a `304 Not Modified` status if the content for that url has not changed.\n\n## Clearing related cache\n\nBy setting the `clearRelatedCache` to `true`, the middleware will inspect the Strapi models before a cache clearing operation to locate models that have relations with the queried model so that their cache is also cleared (this clears the whole cache for the related models). The ispection is performed by looking for direct relations between models and also by doing a deep dive in components, looking for relations to the queried model there too.\n\n## Cache entry point\n\n### Koa Context\n\nBy setting the `populateContext` configuration to `true`, the middleware will extend the Koa Context with an entry point which can be used to clear the cache from within controllers\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      populateContext: true,\n      models: ['post']\n    }\n  }\n});\n\n// controller\n\nmodule.exports = {\n  async index(ctx) {\n    ctx.middleware.cache.store // A direct access to the cache engine\n    await ctx.middleware.cache.bust({ model: 'posts', id: '123' }); // Will bust the cache for this specific record\n    await ctx.middleware.cache.bust({ model: 'posts' }); // Will bust the cache for the entire model collection\n    await ctx.middleware.cache.bust({ model: 'homepage' }); // For single types, do not pluralize the model name\n\n    // ...\n  }\n};\n```\n\n**IMPORTANT**: We do not recommend using this unless truly necessary. It is disabled by default as it goes against the non-intrusive/transparent nature of this middleware.\n\n### Strapi Middleware\n\nBy setting the `populateStrapiMiddleware` configuration to `true`, the middleware will extend the Strapi middleware object with an entry point which can be used to clear the cache from anywhere (e.g., inside a Model's lifecycle hook where `ctx` is not available).\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      populateStrapiMiddleware: true,\n      models: ['post']\n    }\n  }\n});\n\n// model\n\nmodule.exports = {\n  lifecycles: {\n    async beforeUpdate(params, data) {\n      strapi.middleware.cache.store // A direct access to the cache engine\n      await strapi.middleware.cache.bust({ model: 'posts', id: '123' }); // Will bust the cache for this specific record\n\n      // ...\n    }\n  }\n};\n```\n\n**IMPORTANT**: We do not recommend using this unless truly necessary. It is disabled by default as it goes against the non-intrusive/transparent nature of this middleware.\n\n## Admin panel interactions\n\nThe strapi admin panel uses a separate rest api to apply changes to records, e.g `/content-manager/explorer/application::post.post` the middleware will also watch for write operations on that endpoint and bust the cache accordingly\n","readmeFilename":"README.md","gitHead":"64e0b73e0e1e6f77424172d4da4af6810f8d4757","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@1.5.0-beta.0","_nodeVersion":"14.2.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Rl4AM7IL8kVRURSk0R5Ai/FJIwPiGNunqMJLF7u4kNcYNrnNtkE+7h5SUM/P370GfkT3aApRos2XhD7eHST/5g==","shasum":"1db6f880bd20b92bf9bac677b3b687ce2106aee7","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-1.5.0-beta.0.tgz","fileCount":14,"unpackedSize":42493,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHRWzCRA9TVsSAnZWagAA5joP/12Ssl0/AtfP/ww3uLI+\nB2VR+SliuhXZUht647xtMUpnp0XkuBjsB48TTQycl0M1UOrx0MwllshhhbGe\nClF3RSWv3sV1j0AGyBiXiXzojt+mCEAFiNStT2+cITnP5fUpthJ2PKPINsJN\nwjiwmOzBo1TBmnqAiUzMCRHTKPyr8NiGpZ3L7RNOwV88Zzo8j0fQeL9U1aaE\nCzwUuxuDCS3bCA2IbC1wtoF38xLN//UTvsB2dJUG7NYJemXgRyflOUEWf0Mm\nLG07bRGiJ18L9CZNjl6NkZuzNveiFpdn2AeAZvaCEmBT385oIiiqFfuWhVii\nkN/X1nm2Ul/Gxwv+vy3hvXY10qEh6GSxWPfUWnofHYuDPZdVIYPiamTZVBOE\nDgYQ4q2AAMcy3n7zcmxNPe/yBRnGG4wndbTwBDcm5OYXlDVj/szUuvSg3U9O\nfgQbCTU0J2fR1rDJZc6fN0Jz2gzixdSDAPjKrA9BUcDQckHYnajeKdO0SNqq\nan3UJAtO7wkxWbjVxRggMLgO8VLpjJ28GkT0gRtNqY9/tC3Bd8WnYtyRnMuU\nEZ9a6z3RxaWTYVkLNO0k4c9xI4kkRHR6t2dFJF0USVIH0PtPx3SSFLtzncwN\nwHtk6TG2C4idaYS6GP/K49bGH1R//38BaZC0QNn60IEtwNnWcpPSmxbVTvqJ\nyRjs\r\n=2AS+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGb8ZP3nGlsshgQT2fha+hyHDA7YffbvSmYZD5E0VBHlAiAzRJ+ftFuZ1gNgDHNBsmdlkwXoHR2UL2OV9u5Pxce+Bg=="}]},"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"maintainers":[{"name":"patrixr","email":"patrick.rabier@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_1.5.0-beta.0_1612518835263_0.4878966755074514"},"_hasShrinkwrap":false},"1.5.0":{"name":"strapi-middleware-cache","version":"1.5.0","description":"Cache strapi requests","main":"./lib","scripts":{"test":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","pluralize":"^8.0.0","redis-lru":"^0.6.0","semver":"^7.3.4"},"devDependencies":{"chai":"^4.2.0","koa":"^2.11.0","mocha":"^7.1.1","sinon":"^9.2.4","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2"},"gitHead":"4e883d657ab6251758a7dbd0f32362c3308cede6","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@1.5.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-w8uLvQUePQELjC+ErJrxtOsIyeygw5Czs7DUXZ1h+O0To8MNuvvDThbIpmVH/2uVzy7QiH88AZPewxwkg5exTA==","shasum":"da1bb186118997639cb19a321ff162d1c0f4660e","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-1.5.0.tgz","fileCount":13,"unpackedSize":41237,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNwaCCRA9TVsSAnZWagAABh4P/134FU7SXqSmdIa1rH9R\nmdNyYu3CRWL0v4Ip4n4VyDASIYhpyClmLUR2WGWqSD90ACNmVxGeatPNYLeG\nVOL/GOAScHRAtvbhZclveKZA9dVpL9bLBIL2AHSr7uc32UbCuULBdASTRvZ9\n5J3J8TU2i0zqQ7l2JYHq+SqDDdYqQJ37Olb5s1JFeHU0SIkXKazrIreDdH0J\n2tl1IPfY6+3W2RzdH0baftkLevEpG8Hkv96Wq1AXq4BWENbAfakBDiGGdEga\nvRlN8ENCflUPWXPSDgjo0L4jYwkA9QkjN7g3Q2eFQOxxi4YpboAflIa/5h0L\nDDGGyRRJgStSiAlnHEFdSUx/IhYcXeQNOJbSx5WMOTC9dHs73JGloi0FnG+9\nJ4PsAAUpIDX01Z/m3mRwZl0CWtFv+efjVm1aMNTz2eXC5ib4gKi0a3SSUnMr\npioLqS0Njcm4FyTFqJFuXYak4Y4ia1/fD24Eo1LFFaErkdbBsd6EkUMVf+02\n5oXCQvxedaCzobdxOh1vDn7RO9HMAJXLcZA+FUMMQ4PIDrnjKSieJCX1E6fu\n00i9DaOw2fvv607BUSQkH5P74ZHKMkPEjoJf+OlwXvzWmbASjQ37kFc/i6kk\n02qmMtUSiqYcakXdvgERTbm/6zRTOHCrWWeGlE1jRnOaV51VR3m5c/35hGe5\nBI/n\r\n=o8Dr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGyl5cffWQf7ZAJov/JQ9MyGudTto6gdOMiFH8VHCn8wIgXP7Fs5U3zZlXduiO6WbpmsaYKAyb4Pf1Fm6LH3hMVPM="}]},"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"maintainers":[{"name":"patrixr","email":"patrick.rabier@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_1.5.0_1614218881792_0.6438283979439605"},"_hasShrinkwrap":false},"2.0.0":{"name":"strapi-middleware-cache","version":"2.0.0","description":"Cache strapi requests","main":"./lib","scripts":{"test":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","pluralize":"^8.0.0","redis-lru":"^0.6.0","semver":"^7.3.4"},"devDependencies":{"chai":"^4.2.0","koa":"^2.11.0","mocha":"^7.1.1","sinon":"^9.2.4","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2"},"gitHead":"0a9f23e5b989c31f9e3b6c357053c8d8651ea395","readme":"# Strapi LRU Caching middleware\n\nA cache middleware for the headless CMS strapi.io\n\n![](https://github.com/patrixr/strapi-middleware-cache/workflows/Tests/badge.svg)\n![Maintenance](https://img.shields.io/badge/Maintenance%20-Actively%20Maintained-green.svg)\n\n## How it works\n\nThis middleware caches incoming `GET` requests on the strapi API, based on query params and model ID.\nThe cache is automatically busted everytime a `PUT`, `POST`, or `DELETE` request comes in.\n\nSupported storage engines\n\n- Memory _(default)_\n- Redis\n\nImportant: Caching must be explicitely enabled **per model**\n\n## Installing\n\nUsing npm\n\n```bash\nnpm install --save strapi-middleware-cache\n```\n\nUsing yarn\n\n```bash\nyarn add strapi-middleware-cache\n```\n\n## Setup\n\nFor Strapi stable versions, add a `middleware.js` file within your config folder\n\ne.g\n\n```bash\ntouch config/middleware.js\n```\n\nTo use different settings per environment, see the [Strapi docs for environments](https://strapi.io/documentation/v3.x/concepts/configurations.html#environments).\n\nYou can parse environment variables for the config here as well if you wish to, please see the [Strapi docs for environment variables](https://strapi.io/documentation/v3.x/concepts/configurations.html#environment-variables).\n\nEnable the cache middleware by adding the following snippet to an empty middleware file or simply add in the settings from the below example:\n\n```javascript\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n    }\n  }\n});\n```\n\nStarting the CMS should now log the following\n\n```\n$ strapi develop\n[2020-04-14T11:12:41.648Z] debug [Cache] Mounting LRU cache middleware\n[2020-04-14T11:12:41.648Z] debug [Cache] Storage engine: mem\n```\n\n## Configure models\n\nThe middleware will only cache models which have been explicitely enabled.\nAdd a list of models to enable to the module's configuration object.\n\ne.g\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      models: ['posts'],\n    }\n  }\n});\n```\n\nStarting the CMS should now log the following\n\n```\n$ strapi develop\n[2020-04-14T11:12:41.648Z] debug [Cache] Mounting LRU cache middleware\n[2020-04-14T11:12:41.648Z] debug [Cache] Storage engine: mem\n[2020-04-14T11:12:41.653Z] debug [Cache] Caching route /posts/:id* [maxAge=3600000]\n```\n\n## Configure the storage engine\n\nThe module's configuration object supports the following properties\n\n| Property                   | Default | Description                                                                           |\n| -------------------------- | ------- | ------------------------------------------------------------------------------------- |\n| type                       | mem     | The type of storage engine to use (`mem` or `redis`)                                  |\n| max                        | 500     | Max number of entries in the cache                                                    |\n| maxAge                     | 3600000 | Time in milliseconds after which a cache entry is invalidated                         |\n| cacheTimeout               | 500     | Time in milliseconds after which a cache request is timed out                         |\n| enableEtagSupport.         | false   | If set to true, will support [etag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) in headers                                   |\n| logs                       | true    | Setting it to false will disable any console output                                   |\n| populateContext            | false   | Setting it to true will inject a cache entry point into the Koa context               |\n| redisConfig _(redis only)_ | {}      | The redis config object passed on to [ioredis](https://www.npmjs.com/package/ioredis) |\n\n### Example\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      type: 'redis',\n      maxAge: 3600000,\n      models: ['posts'],\n      redisConfig: {\n        sentinels: [\n          { host: '192.168.10.41', port: 26379 },\n          { host: '192.168.10.42', port: 26379 },\n          { host: '192.168.10.43', port: 26379 },\n        ],\n        name: 'redis-primary',\n      }\n    }\n  }\n});\n```\n\nRunning the CMS will output the following\n\n```\n$ strapi develop\n[2020-04-14T11:31:05.751Z] debug [Cache] Mounting LRU cache middleware\n[2020-04-14T11:31:05.752Z] debug [Cache] Storage engine: redis\n[2020-04-14T11:31:05.784Z] debug [Cache] Caching route /listings/:id* [maxAge=3600000]\n[2020-04-14T11:31:06.076Z] debug [Cache] Redis connection established\n```\n\n## Per-Model Configuration\n\nEach route can hold its own configuration object for more granular control. This can be done simply\nby replacing the model strings in the list by object.\n\nOn which you can set:\n- Its own custom `maxAge`\n- Headers to include in the cache-key (e.g the body may differ depending on the language requested)\n\ne.g\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      type: 'redis',\n      maxAge: 3600000,\n      models: [\n        {\n          model: 'listings',\n          maxAge: 1000000,\n        },\n        {\n          model: 'account',\n          headers: ['accept-language']\n        }\n      ]\n    }\n  }\n});\n```\n\nRunning the CMS should now show the following\n\n```\n$ strapi develop\n[2020-04-14T11:37:16.510Z] debug [Cache] Mounting LRU cache middleware\n[2020-04-14T11:37:16.511Z] debug [Cache] Storage engine: redis\n[2020-04-14T11:37:16.600Z] debug [Cache] Caching route /listings/:id* [maxAge=1000000]\n[2020-04-14T11:37:16.946Z] debug [Cache] Redis connection established\n```\n\n## Pluralization and Single types\n\nBy default, the middleware assumes that the specified models are collections. Meaning that having `'post'` or `'posts'` in your configuration will result in the `/posts/*` being cached. Pluralization is applied in order to match the Strapi generated endpoints.\n\nThat behaviour is however not desired for [single types](https://strapi.io/blog/beta-19-single-types-uid-field) such as `homepage` which should remain singular in the endpoint (`/homepage`)\n\nYou can mark a specific model as being a single type by using the `singleType` boolean field on model configurations\n\ne.g\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      models: [\n        {\n          model: 'homepage',\n          singleType: true,\n        }\n      ]\n    }\n  }\n});\n```\n\n## Etag support\n\nBy setting the `enableEtagSupport` to `true`, the middleware will automatically create an Etag for each payload it caches.\n\nFurther requests sent with the `If-None-Match` header will be returned a `304 Not Modified` status if the content for that url has not changed.\n\n## Clearing related cache\n\nBy setting the `clearRelatedCache` to `true`, the middleware will inspect the Strapi models before a cache clearing operation to locate models that have relations with the queried model so that their cache is also cleared (this clears the whole cache for the related models). The ispection is performed by looking for direct relations between models and also by doing a deep dive in components, looking for relations to the queried model there too.\n\n## Cache entry point\n\n### Koa Context\n\nBy setting the `populateContext` configuration to `true`, the middleware will extend the Koa Context with an entry point which can be used to clear the cache from within controllers\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      populateContext: true,\n      models: ['post']\n    }\n  }\n});\n\n// controller\n\nmodule.exports = {\n  async index(ctx) {\n    ctx.middleware.cache.store // A direct access to the cache engine\n    await ctx.middleware.cache.bust({ model: 'posts', id: '123' }); // Will bust the cache for this specific record\n    await ctx.middleware.cache.bust({ model: 'posts' }); // Will bust the cache for the entire model collection\n    await ctx.middleware.cache.bust({ model: 'homepage' }); // For single types, do not pluralize the model name\n\n    // ...\n  }\n};\n```\n\n**IMPORTANT**: We do not recommend using this unless truly necessary. It is disabled by default as it goes against the non-intrusive/transparent nature of this middleware.\n\n### Strapi Middleware\n\nBy setting the `populateStrapiMiddleware` configuration to `true`, the middleware will extend the Strapi middleware object with an entry point which can be used to clear the cache from anywhere (e.g., inside a Model's lifecycle hook where `ctx` is not available).\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      populateStrapiMiddleware: true,\n      models: ['post']\n    }\n  }\n});\n\n// model\n\nmodule.exports = {\n  lifecycles: {\n    async beforeUpdate(params, data) {\n      strapi.middleware.cache.store // A direct access to the cache engine\n      await strapi.middleware.cache.bust({ model: 'posts', id: '123' }); // Will bust the cache for this specific record\n\n      // ...\n    }\n  }\n};\n```\n\n**IMPORTANT**: We do not recommend using this unless truly necessary. It is disabled by default as it goes against the non-intrusive/transparent nature of this middleware.\n\n## Admin panel interactions\n\nThe strapi admin panel uses a separate rest api to apply changes to records, e.g `/content-manager/explorer/application::post.post` the middleware will also watch for write operations on that endpoint and bust the cache accordingly\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@2.0.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-1o486XonrnNtMc5rPBSKxtARvSx1NnzABOKv4YGcbnPRiqkzJ9z173BbkG3j5gehKbBkOrmqCGUOQbPwDXcwmw==","shasum":"b4de9999fe0677ee797a1397eedfc85438dc2eab","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-2.0.0.tgz","fileCount":14,"unpackedSize":42054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOHmPCRA9TVsSAnZWagAA68kP/07JbULIEo+vqRoG/fc5\njBVsUckBWLQN8/gtZSPb0c2yVITVo/e7b6na8J1iXoKbNK8WDpZRBfJcmWew\nzzp8O2lfb1aqtFf16i0avu4T6dO3wJsIFELfDx+pL2NVKFMs5JsKWXAMpE6H\nNzPqfCeorU3/S5MIPCRZwd4vNCD3pkdvA5TgUhr2zTP0g15N5bU0Vxh00Op9\nsbG8UD3B2GzV1DxfP9SHZpT3/tNlF5uyzMD/Wg1GGXLESklK7i3Sxr/le+zi\nCwat1rWhivzD1qc/PjGOXren1EXO/nZukbFjYP6xCi+9bzRimNBnQF5Xe98d\nVpDrbDPZC7po6lR5edu3bCsz5y5aGnHlb8lke14/3Ih1Weldq25tFrmaUKkh\n4QlbdI4zzEC3WLlTz7wF1/Wwdp0KeqHam7ZLlVUazpwc6Aco9FG73CZ93U0K\nIdxD+X0IOYgUZrL5bAIjY0GpG3S5rDluUmHmU2JtNmKltNuK1fzRurZweu0h\nsmZp+dpyJ8q/6CXq/mMbafjOtNx6HQ/SnT9yLwM0u02CH3nm8e0yoImBPoeS\nauS3wdUX9xSy1lcNtJbUpTy2EH52gJt+rAB7vZO1J8atSksgY995Zjb9HDin\nBIJF5LEKrv8FbSCAN5EuqCELBFDc/ilTH8lRPy961OaQJxwwo6BNiHeKSj8A\nbA4j\r\n=ZTmf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDRcPfVbKrwy59+f4nfh+i/gSZgB2863dxSVfKbrZ25egIga9NpnXTw6mNYaonSOCLzE604MiDNHTNer4AkjljMGnQ="}]},"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"maintainers":[{"name":"patrixr","email":"patrick.rabier@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_2.0.0_1614313870828_0.29940512459242585"},"_hasShrinkwrap":false},"2.0.1-beta.0":{"name":"strapi-middleware-cache","version":"2.0.1-beta.0","description":"Cache strapi requests","main":"./lib","scripts":{"test":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","pluralize":"^8.0.0","redis-lru":"^0.6.0","semver":"^7.3.4"},"devDependencies":{"chai":"^4.2.0","koa":"^2.11.0","mocha":"^7.1.1","sinon":"^9.2.4","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2"},"gitHead":"c1372493a818c658847e80ad395099abc3db989d","readme":"# Strapi LRU Caching middleware\n\nA cache middleware for the headless CMS strapi.io\n\n![](https://github.com/patrixr/strapi-middleware-cache/workflows/Tests/badge.svg)\n![Maintenance](https://img.shields.io/badge/Maintenance%20-Actively%20Maintained-green.svg)\n\n## How it works\n\nThis middleware caches incoming `GET` requests on the strapi API, based on query params and model ID.\nThe cache is automatically busted everytime a `PUT`, `POST`, or `DELETE` request comes in.\n\nSupported storage engines\n\n- Memory _(default)_\n- Redis\n\nImportant: Caching must be explicitely enabled **per model**\n\n## Installing\n\nUsing npm\n\n```bash\nnpm install --save strapi-middleware-cache\n```\n\nUsing yarn\n\n```bash\nyarn add strapi-middleware-cache\n```\n\n## Setup\n\nFor Strapi stable versions, add a `middleware.js` file within your config folder\n\ne.g\n\n```bash\ntouch config/middleware.js\n```\n\nTo use different settings per environment, see the [Strapi docs for environments](https://strapi.io/documentation/v3.x/concepts/configurations.html#environments).\n\nYou can parse environment variables for the config here as well if you wish to, please see the [Strapi docs for environment variables](https://strapi.io/documentation/v3.x/concepts/configurations.html#environment-variables).\n\nEnable the cache middleware by adding the following snippet to an empty middleware file or simply add in the settings from the below example:\n\n```javascript\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n    }\n  }\n});\n```\n\nStarting the CMS should now log the following\n\n```\n$ strapi develop\n[2020-04-14T11:12:41.648Z] debug [Cache] Mounting LRU cache middleware\n[2020-04-14T11:12:41.648Z] debug [Cache] Storage engine: mem\n```\n\n## Configure models\n\nThe middleware will only cache models which have been explicitely enabled.\nAdd a list of models to enable to the module's configuration object.\n\ne.g\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      models: ['posts'],\n    }\n  }\n});\n```\n\nStarting the CMS should now log the following\n\n```\n$ strapi develop\n[2020-04-14T11:12:41.648Z] debug [Cache] Mounting LRU cache middleware\n[2020-04-14T11:12:41.648Z] debug [Cache] Storage engine: mem\n[2020-04-14T11:12:41.653Z] debug [Cache] Caching route /posts/:id* [maxAge=3600000]\n```\n\n## Configure the storage engine\n\nThe module's configuration object supports the following properties\n\n| Property                   | Default | Description                                                                           |\n| -------------------------- | ------- | ------------------------------------------------------------------------------------- |\n| type                       | mem     | The type of storage engine to use (`mem` or `redis`)                                  |\n| max                        | 500     | Max number of entries in the cache                                                    |\n| maxAge                     | 3600000 | Time in milliseconds after which a cache entry is invalidated                         |\n| cacheTimeout               | 500     | Time in milliseconds after which a cache request is timed out                         |\n| enableEtagSupport.         | false   | If set to true, will support [etag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) in headers                                   |\n| logs                       | true    | Setting it to false will disable any console output                                   |\n| populateContext            | false   | Setting it to true will inject a cache entry point into the Koa context               |\n| redisConfig _(redis only)_ | {}      | The redis config object passed on to [ioredis](https://www.npmjs.com/package/ioredis) |\n\n### Example\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      type: 'redis',\n      maxAge: 3600000,\n      models: ['posts'],\n      redisConfig: {\n        sentinels: [\n          { host: '192.168.10.41', port: 26379 },\n          { host: '192.168.10.42', port: 26379 },\n          { host: '192.168.10.43', port: 26379 },\n        ],\n        name: 'redis-primary',\n      }\n    }\n  }\n});\n```\n\nRunning the CMS will output the following\n\n```\n$ strapi develop\n[2020-04-14T11:31:05.751Z] debug [Cache] Mounting LRU cache middleware\n[2020-04-14T11:31:05.752Z] debug [Cache] Storage engine: redis\n[2020-04-14T11:31:05.784Z] debug [Cache] Caching route /listings/:id* [maxAge=3600000]\n[2020-04-14T11:31:06.076Z] debug [Cache] Redis connection established\n```\n\n## Per-Model Configuration\n\nEach route can hold its own configuration object for more granular control. This can be done simply\nby replacing the model strings in the list by object.\n\nOn which you can set:\n- Its own custom `maxAge`\n- Headers to include in the cache-key (e.g the body may differ depending on the language requested)\n\ne.g\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      type: 'redis',\n      maxAge: 3600000,\n      models: [\n        {\n          model: 'listings',\n          maxAge: 1000000,\n        },\n        {\n          model: 'account',\n          headers: ['accept-language']\n        }\n      ]\n    }\n  }\n});\n```\n\nRunning the CMS should now show the following\n\n```\n$ strapi develop\n[2020-04-14T11:37:16.510Z] debug [Cache] Mounting LRU cache middleware\n[2020-04-14T11:37:16.511Z] debug [Cache] Storage engine: redis\n[2020-04-14T11:37:16.600Z] debug [Cache] Caching route /listings/:id* [maxAge=1000000]\n[2020-04-14T11:37:16.946Z] debug [Cache] Redis connection established\n```\n\n## Pluralization and Single types\n\nBy default, the middleware assumes that the specified models are collections. Meaning that having `'post'` or `'posts'` in your configuration will result in the `/posts/*` being cached. Pluralization is applied in order to match the Strapi generated endpoints.\n\nThat behaviour is however not desired for [single types](https://strapi.io/blog/beta-19-single-types-uid-field) such as `homepage` which should remain singular in the endpoint (`/homepage`)\n\nYou can mark a specific model as being a single type by using the `singleType` boolean field on model configurations\n\ne.g\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      models: [\n        {\n          model: 'homepage',\n          singleType: true,\n        }\n      ]\n    }\n  }\n});\n```\n\n## Etag support\n\nBy setting the `enableEtagSupport` to `true`, the middleware will automatically create an Etag for each payload it caches.\n\nFurther requests sent with the `If-None-Match` header will be returned a `304 Not Modified` status if the content for that url has not changed.\n\n## Clearing related cache\n\nBy setting the `clearRelatedCache` to `true`, the middleware will inspect the Strapi models before a cache clearing operation to locate models that have relations with the queried model so that their cache is also cleared (this clears the whole cache for the related models). The ispection is performed by looking for direct relations between models and also by doing a deep dive in components, looking for relations to the queried model there too.\n\n## Cache entry point\n\n### Koa Context\n\nBy setting the `populateContext` configuration to `true`, the middleware will extend the Koa Context with an entry point which can be used to clear the cache from within controllers\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      populateContext: true,\n      models: ['post']\n    }\n  }\n});\n\n// controller\n\nmodule.exports = {\n  async index(ctx) {\n    ctx.middleware.cache.store // A direct access to the cache engine\n    await ctx.middleware.cache.bust({ model: 'posts', id: '123' }); // Will bust the cache for this specific record\n    await ctx.middleware.cache.bust({ model: 'posts' }); // Will bust the cache for the entire model collection\n    await ctx.middleware.cache.bust({ model: 'homepage' }); // For single types, do not pluralize the model name\n\n    // ...\n  }\n};\n```\n\n**IMPORTANT**: We do not recommend using this unless truly necessary. It is disabled by default as it goes against the non-intrusive/transparent nature of this middleware.\n\n### Strapi Middleware\n\nBy setting the `populateStrapiMiddleware` configuration to `true`, the middleware will extend the Strapi middleware object with an entry point which can be used to clear the cache from anywhere (e.g., inside a Model's lifecycle hook where `ctx` is not available).\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      populateStrapiMiddleware: true,\n      models: ['post']\n    }\n  }\n});\n\n// model\n\nmodule.exports = {\n  lifecycles: {\n    async beforeUpdate(params, data) {\n      strapi.middleware.cache.store // A direct access to the cache engine\n      await strapi.middleware.cache.bust({ model: 'posts', id: '123' }); // Will bust the cache for this specific record\n\n      // ...\n    }\n  }\n};\n```\n\n**IMPORTANT**: We do not recommend using this unless truly necessary. It is disabled by default as it goes against the non-intrusive/transparent nature of this middleware.\n\n## Admin panel interactions\n\nThe strapi admin panel uses a separate rest api to apply changes to records, e.g `/content-manager/explorer/application::post.post` the middleware will also watch for write operations on that endpoint and bust the cache accordingly\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@2.0.1-beta.0","_nodeVersion":"12.20.2","_npmVersion":"6.14.11","dist":{"integrity":"sha512-TySt6TDvTss0aZNUGIE7q3NM3E5VAHfo4/SIY3GmaVBGADhg6id/JFIx16JM8Y1icsmska+tQKGPy97IyvmEuA==","shasum":"6b7e6569c9a20d25d8c3ba6bb74e7c7615302848","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-2.0.1-beta.0.tgz","fileCount":14,"unpackedSize":42061,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOHpJCRA9TVsSAnZWagAAlXAQAJexUWSiNXIDET962usk\nlhSR4wdd/XceHAj4VHUn3tc3CMEookCUB6nPppYUVazT2B53asLNLqzF/vQC\nzMJPLLZU2lv8w+a/edpSbJccfc1qb9cUYd8Q0quoiH6d3smZUEf5t9lvH8fH\nPY1x7aLucc/LYDCGEFF8A4OgBlBJuBbYtTZ9vaOlms5wdA547P7KXcMTo4R7\n2UvfXcXYd36OVxK6kbLlxPKz9bww+vQoCXV+BmSWc12FvDL3AibXXI7JT7z+\n8w//crz/3f/Ic5DD9U09DujIvwztQwJrPVlPwiYiyubzN3B5tQTQiGgZ1rnZ\nsYcEwLxzhjubugctZZRli4QmIjdIlipsU9GgDVqh3BLqmkVlOnXL6AUjTXgG\nGpftcmV63G/TkCyKeD1fuyu8oS8osaeqKe6OfhBsNEekFteC0nndq5HFvGeo\nM4N2bqYub8pX4Vd9ZSd4X8F+vLQQcsqH5O1Ejrj2ByNzlfNiLPTpxKoD8bre\nIovHBVL+2mi2eSITc+DZNFKOf4lsiYanhhiFgnoZYlk5rPmgO1NnZGDMdGyV\nuTqwkN1vWU/Y9RXFoe/RhhVzmyX/8K52uHzuL1Y4woMdEdP9hvLO881XskpR\neVDPWn15wglHloIsbnlJrz+P8Y5je8GVuLlSkAAzNyJiZDpR0tzNh+gleQvA\n2aeC\r\n=Pc3o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGPY/At7CJEnBidKMqiPb3OVFw/T68p4+9VA+ahDuKL8AiEA0fxk87tG1ca8ayYcUiajIOGfbyUiVScmHB/89lFT6Q8="}]},"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"maintainers":[{"name":"patrixr","email":"patrick.rabier@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_2.0.1-beta.0_1614314056706_0.29662543464999724"},"_hasShrinkwrap":false},"2.0.1-beta.1":{"name":"strapi-middleware-cache","version":"2.0.1-beta.1","description":"Cache strapi requests","main":"./lib","scripts":{"test":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"chalk":"^4.1.0","ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","path-to-regexp":"^6.2.0","pluralize":"^8.0.0","redis-lru":"^0.6.0"},"devDependencies":{"chai":"^4.2.0","koa":"^2.11.0","mocha":"^7.1.1","sinon":"^9.2.4","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2"},"peerDependencies":{},"gitHead":"188f179b037d7f0b8c37ad04f9d793ff85f2ed96","readme":"# Strapi LRU Caching middleware\n\n:warning: You are on beta branch\n\nA cache middleware for the headless CMS strapi.io\n\n![](https://github.com/patrixr/strapi-middleware-cache/workflows/Tests/badge.svg)\n![Maintenance](https://img.shields.io/badge/Maintenance%20-Actively%20Maintained-green.svg)\n\n## How it works\n\nThis middleware caches incoming `GET` requests on the strapi API, based on query params and model ID.\nThe cache is automatically busted everytime a `PUT`, `POST`, or `DELETE` request comes in.\n\nSupported storage engines\n\n- Memory _(default)_\n- Redis\n\nImportant: Caching must be explicitely enabled **per model**\n\n## Installing\n\nUsing npm\n\n```bash\nnpm install --save strapi-middleware-cache@beta\n```\n\nUsing yarn\n\n```bash\nyarn add strapi-middleware-cache@beta\n```\n\n## Setup\n\nFor Strapi stable versions, add a `middleware.js` file within your config folder\n\ne.g\n\n```bash\ntouch config/middleware.js\n```\n\nTo use different settings per environment, see the [Strapi docs for environments](https://strapi.io/documentation/v3.x/concepts/configurations.html#environments).\n\nYou can parse environment variables for the config here as well if you wish to, please see the [Strapi docs for environment variables](https://strapi.io/documentation/v3.x/concepts/configurations.html#environment-variables).\n\nEnable the cache middleware by adding the following snippet to an empty middleware file or simply add in the settings from the below example:\n\n```javascript\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n    }\n  }\n});\n```\n\nStarting the CMS should now log the following\n\n```\n$ strapi develop\n[2020-04-14T11:12:41.648Z] debug [Cache] Mounting LRU cache middleware\n[2020-04-14T11:12:41.648Z] debug [Cache] Storage engine: mem\n```\n\n## Configure models\n\nThe middleware will only cache models which have been explicitely enabled.\nAdd a list of models to enable to the module's configuration object.\n\ne.g\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      models: ['posts'],\n    }\n  }\n});\n```\n\nStarting the CMS should now log the following\n\n```\n$ strapi develop\n[2020-04-14T11:12:41.648Z] debug [Cache] Mounting LRU cache middleware\n[2020-04-14T11:12:41.648Z] debug [Cache] Storage engine: mem\n[2020-04-14T11:12:41.653Z] debug [Cache] Caching route /posts/:id* [maxAge=3600000]\n```\n\n## Configure the storage engine\n\nThe module's configuration object supports the following properties\n\n| Property                   | Default | Description                                                                           |\n| -------------------------- | ------- | ------------------------------------------------------------------------------------- |\n| type                       | mem     | The type of storage engine to use (`mem` or `redis`)                                  |\n| max                        | 500     | Max number of entries in the cache                                                    |\n| maxAge                     | 3600000 | Time in milliseconds after which a cache entry is invalidated                         |\n| cacheTimeout               | 500     | Time in milliseconds after which a cache request is timed out                         |\n| enableEtagSupport.         | false   | If set to true, will support [etag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) in headers                                   |\n| logs                       | true    | Setting it to false will disable any console output                                   |\n| populateContext            | false   | Setting it to true will inject a cache entry point into the Koa context               |\n| redisConfig _(redis only)_ | {}      | The redis config object passed on to [ioredis](https://www.npmjs.com/package/ioredis) |\n\n### Example\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      type: 'redis',\n      maxAge: 3600000,\n      models: ['posts'],\n      redisConfig: {\n        sentinels: [\n          { host: '192.168.10.41', port: 26379 },\n          { host: '192.168.10.42', port: 26379 },\n          { host: '192.168.10.43', port: 26379 },\n        ],\n        name: 'redis-primary',\n      }\n    }\n  }\n});\n```\n\nRunning the CMS will output the following\n\n```\n$ strapi develop\n[2020-04-14T11:31:05.751Z] debug [Cache] Mounting LRU cache middleware\n[2020-04-14T11:31:05.752Z] debug [Cache] Storage engine: redis\n[2020-04-14T11:31:05.784Z] debug [Cache] Caching route /listings/:id* [maxAge=3600000]\n[2020-04-14T11:31:06.076Z] debug [Cache] Redis connection established\n```\n\n## Per-Model Configuration\n\nEach route can hold its own configuration object for more granular control. This can be done simply\nby replacing the model strings in the list by object.\n\nOn which you can set:\n- Its own custom `maxAge`\n- Headers to include in the cache-key (e.g the body may differ depending on the language requested)\n\ne.g\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      type: 'redis',\n      maxAge: 3600000,\n      models: [\n        {\n          model: 'listings',\n          maxAge: 1000000,\n        },\n        {\n          model: 'account',\n          headers: ['accept-language']\n        }\n      ]\n    }\n  }\n});\n```\n\nRunning the CMS should now show the following\n\n```\n$ strapi develop\n[2020-04-14T11:37:16.510Z] debug [Cache] Mounting LRU cache middleware\n[2020-04-14T11:37:16.511Z] debug [Cache] Storage engine: redis\n[2020-04-14T11:37:16.600Z] debug [Cache] Caching route /listings/:id* [maxAge=1000000]\n[2020-04-14T11:37:16.946Z] debug [Cache] Redis connection established\n```\n\n## Pluralization and Single types\n\nBy default, the middleware assumes that the specified models are collections. Meaning that having `'post'` or `'posts'` in your configuration will result in the `/posts/*` being cached. Pluralization is applied in order to match the Strapi generated endpoints.\n\nThat behaviour is however not desired for [single types](https://strapi.io/blog/beta-19-single-types-uid-field) such as `homepage` which should remain singular in the endpoint (`/homepage`)\n\nYou can mark a specific model as being a single type by using the `singleType` boolean field on model configurations\n\ne.g\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      models: [\n        {\n          model: 'homepage',\n          singleType: true,\n        }\n      ]\n    }\n  }\n});\n```\n\n## Etag support\n\nBy setting the `enableEtagSupport` to `true`, the middleware will automatically create an Etag for each payload it caches.\n\nFurther requests sent with the `If-None-Match` header will be returned a `304 Not Modified` status if the content for that url has not changed.\n\n## Clearing related cache\n\nBy setting the `clearRelatedCache` to `true`, the middleware will inspect the Strapi models before a cache clearing operation to locate models that have relations with the queried model so that their cache is also cleared (this clears the whole cache for the related models). The ispection is performed by looking for direct relations between models and also by doing a deep dive in components, looking for relations to the queried model there too.\n\n## Cache entry point\n\n### Koa Context\n\nBy setting the `populateContext` configuration to `true`, the middleware will extend the Koa Context with an entry point which can be used to clear the cache from within controllers\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      populateContext: true,\n      models: ['post']\n    }\n  }\n});\n\n// controller\n\nmodule.exports = {\n  async index(ctx) {\n    ctx.middleware.cache.store // A direct access to the cache engine\n    await ctx.middleware.cache.bust({ model: 'posts', id: '123' }); // Will bust the cache for this specific record\n    await ctx.middleware.cache.bust({ model: 'posts' }); // Will bust the cache for the entire model collection\n    await ctx.middleware.cache.bust({ model: 'homepage' }); // For single types, do not pluralize the model name\n\n    // ...\n  }\n};\n```\n\n**IMPORTANT**: We do not recommend using this unless truly necessary. It is disabled by default as it goes against the non-intrusive/transparent nature of this middleware.\n\n### Strapi Middleware\n\nBy setting the `populateStrapiMiddleware` configuration to `true`, the middleware will extend the Strapi middleware object with an entry point which can be used to clear the cache from anywhere (e.g., inside a Model's lifecycle hook where `ctx` is not available).\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      populateStrapiMiddleware: true,\n      models: ['post']\n    }\n  }\n});\n\n// model\n\nmodule.exports = {\n  lifecycles: {\n    async beforeUpdate(params, data) {\n      strapi.middleware.cache.store // A direct access to the cache engine\n      await strapi.middleware.cache.bust({ model: 'posts', id: '123' }); // Will bust the cache for this specific record\n\n      // ...\n    }\n  }\n};\n```\n\n**IMPORTANT**: We do not recommend using this unless truly necessary. It is disabled by default as it goes against the non-intrusive/transparent nature of this middleware.\n\n## Admin panel interactions\n\nThe strapi admin panel uses a separate rest api to apply changes to records, e.g `/content-manager/explorer/application::post.post` the middleware will also watch for write operations on that endpoint and bust the cache accordingly\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@2.0.1-beta.1","_nodeVersion":"14.15.5","_npmVersion":"6.14.11","dist":{"integrity":"sha512-u26iZkKxqLk6gxwLYpeH46sFNHp/zNZkcfrC6X87NIHZZxW07THgAb2q6DuipMCh7OyMtT5JFmr85sfs3tPNlw==","shasum":"f39f16e3b8f7200fe0410dd2159bdd02ac7edfd4","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-2.0.1-beta.1.tgz","fileCount":14,"unpackedSize":54008,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOK4JCRA9TVsSAnZWagAAjEwQAKDCN1wiJ/nSzZP+kHto\niIwSqQC8fGSGWPS2P9WNtz4ut0pPMvj4JZgT0kE9ncin4qFNtrkGTquV2Fwv\nlLFNWxoKrcvxc8hS/qJoAbmL82MNGrFl/stKgBE9AcrbE5mEsGNNOok6kc79\nBeTKQjuogPXfLTEovU37ZHhZPMCiGHErVn0eAEDTFi5YK608hA8gt0JV5ERV\nXhae+V7JlgauPIbjHF1TlPJAnH4fZ5wR+cnHmti5fdU80TwIymoQn4kBPWhS\nsjnIh9HFP5BXpLWczEBLaNDeN3RxsdONy8wP+z3N/xAP3K/qpNya/TmGVc+s\n9m2pvSPuUPCKxS8ADDW7KICFbM/bkZZscRdLdBkKReEWw2FRZO7sUrKFIpKH\nEjslEsOB4o2WH7bqmKpdX66VyhXUtm4yfhScWLkh9+xPqREFjUnGOFSnuZ6F\nbpD+IERilSVuFyOzD+DCKavGXi1omz7voHEJZ8hEBqPf5mVDryAQjq3xkvch\nsnm0xJyPjHvJbx6w7Ry0XGN9Yxqqakxu+Az4PN4EntNAHnDBt75zPIZhVpKc\neWq+XjHTm6P9jCXw24ZsGYQAD3J+Al044zQ/KtL3Va+c807jRDZFlwAR6XYc\nfNBa6j8CZ1Nk0eqnwSKvjcY/YqS+oHR0Wu/oL2Pa7CFDcmvefhaVdTspGYna\n3z9d\r\n=/ogA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDe3QVsxjkcoHI7D3iDbtTsp4uqb8pMMgiYjFXcAaf5pQIgYob6eizXJaxqAwneN12JwHYT3NqzSw4M2xWCYQXsWDA="}]},"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"maintainers":[{"name":"patrixr","email":"patrick.rabier@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_2.0.1-beta.1_1614327305069_0.781653246386586"},"_hasShrinkwrap":false},"2.0.1-beta.2":{"name":"strapi-middleware-cache","version":"2.0.1-beta.2","description":"Cache strapi requests","main":"./lib","scripts":{"test":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"chalk":"^4.1.0","ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","path-to-regexp":"^6.2.0","pluralize":"^8.0.0","redis-lru":"^0.6.0"},"devDependencies":{"chai":"^4.2.0","koa":"^2.11.0","mocha":"^7.1.1","sinon":"^9.2.4","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2"},"peerDependencies":{},"gitHead":"e392b3155a63ae40450fb6848c0294bb444acb84","readme":"# Strapi LRU Caching middleware\n\n:warning: You are on beta branch\n\nA cache middleware for the headless CMS strapi.io\n\n![](https://github.com/patrixr/strapi-middleware-cache/workflows/Tests/badge.svg)\n![Maintenance](https://img.shields.io/badge/Maintenance%20-Actively%20Maintained-green.svg)\n\n## How it works\n\nThis middleware caches incoming `GET` requests on the strapi API, based on query params and model ID.\nThe cache is automatically busted everytime a `PUT`, `PATCH`, `POST`, or `DELETE` request comes in.\n\nSupported storage engines\n\n- Memory _(default)_\n- Redis\n\nImportant: Caching must be explicitely enabled **per model**\n\n## Installing\n\nUsing npm\n\n```bash\nnpm install --save strapi-middleware-cache@beta\n```\n\nUsing yarn\n\n```bash\nyarn add strapi-middleware-cache@beta\n```\n\n## Requirements\n\nSince `2.0.1`:\n- strapi `3.4.0` \n- node `14`\n\n_See `1.5.0` for strapi < `3.4.0`_\n\n## Setup\n\nFor Strapi stable versions, add a `middleware.js` file within your config folder\n\ne.g\n\n```bash\ntouch config/middleware.js\n```\n\nTo use different settings per environment, see the [Strapi docs for environments](https://strapi.io/documentation/v3.x/concepts/configurations.html#environments).\n\nYou can parse environment variables for the config here as well if you wish to, please see the [Strapi docs for environment variables](https://strapi.io/documentation/v3.x/concepts/configurations.html#environment-variables).\n\nEnable the cache middleware by adding the following snippet to an empty middleware file or simply add in the settings from the below example:\n\n```javascript\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n    }\n  }\n});\n```\n\nStarting the CMS should now log the following\n\n```\n$ strapi develop\n[2021-02-26T07:03:18.981Z] info [cache] Mounting LRU cache middleware\n[2021-02-26T07:03:18.982Z] info [cache] Storage engine: mem\n```\n\n## Configure models\n\nThe middleware will only cache models which have been explicitely enabled.\nAdd a list of models to enable to the module's configuration object.\n\ne.g\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      models: ['review'],\n    }\n  }\n});\n```\n\nStarting the CMS should now log the following\n\n```\n$ strapi develop\n[2021-02-26T07:03:18.981Z] info [cache] Mounting LRU cache middleware\n[2021-02-26T07:03:18.982Z] info [cache] Storage engine: mem\n[2021-02-26T07:03:18.985Z] debug [cache] Register review routes middlewares\n[2021-02-26T07:03:18.986Z] debug [cache] POST /reviews purge\n[2021-02-26T07:03:18.987Z] debug [cache] DELETE /reviews/:id purge\n[2021-02-26T07:03:18.987Z] debug [cache] PUT /reviews/:id purge\n[2021-02-26T07:03:18.987Z] debug [cache] GET /reviews recv maxAge=3600000\n[2021-02-26T07:03:18.988Z] debug [cache] GET /reviews/:id recv maxAge=3600000\n[2021-02-26T07:03:18.988Z] debug [cache] GET /reviews/count recv maxAge=3600000\n```\n\n## Configure the storage engine\n\nThe module's configuration object supports the following properties\n\n### Example\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    /**\n     * @typedef {Object} UserMiddlewareCacheConfig\n     * @property {'mem'|'redis'=} type\n     * @property {boolean=} enabled\n     * @property {boolean=} logs\n     * @property {boolean=} populateContext\n     * @property {boolean=} populateStrapiMiddleware\n     * @property {boolean=} enableEtagSupport\n     * @property {boolean=} enableXCacheHeaders\n     * @property {boolean=} clearRelatedCache\n     * @property {boolean=} withKoaContext\n     * @property {boolean=} withStrapiMiddleware\n     * @property {string[]=} headers\n     * @property {number=} max\n     * @property {number=} maxAge\n     * @property {number=} cacheTimeout\n     * @property {(UserModelCacheConfig | string)[]=} models\n     * @property {Object=} redisConfig\n     */\n    cache: {\n      enabled: true,\n      type: 'redis',\n      models: ['review'],\n      redisConfig: {\n        sentinels: [\n          { host: '192.168.10.41', port: 26379 },\n          { host: '192.168.10.42', port: 26379 },\n          { host: '192.168.10.43', port: 26379 },\n        ],\n        name: 'redis-primary',\n      }\n    }\n  }\n});\n```\n\nRunning the CMS will output the following\n\n```\n$ strapi develop\n[2021-02-26T07:03:18.981Z] info [cache] Mounting LRU cache middleware\n[2021-02-26T07:03:18.982Z] info [cache] Storage engine: mem\n[2021-02-26T07:03:18.985Z] debug [cache] Register review routes middlewares\n[2021-02-26T07:03:18.986Z] debug [cache] POST /reviews purge\n[2021-02-26T07:03:18.987Z] debug [cache] DELETE /reviews/:id purge\n[2021-02-26T07:03:18.987Z] debug [cache] PUT /reviews/:id purge\n[2021-02-26T07:03:18.987Z] debug [cache] GET /reviews recv maxAge=3600000\n[2021-02-26T07:03:18.988Z] debug [cache] GET /reviews/:id recv maxAge=3600000\n[2021-02-26T07:03:18.988Z] debug [cache] GET /reviews/count recv maxAge=3600000\n```\n\n## Per-Model Configuration\n\nEach route can hold its own configuration object for more granular control. This can be done simply\nby replacing the model strings in the list by object.\n\nOn which you can set:\n- Its own custom `maxAge`\n- Headers to include in the cache-key (e.g the body may differ depending on the language requested)\n\ne.g\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      type: 'redis',\n      maxAge: 3600000,\n      models: [\n        /**\n         * @typedef {Object} UserModelCacheConfig\n         * @property {string} model\n         * @property {string=} plugin\n         * @property {boolean=} singleType\n         * @property {Hitpass|boolean=} hitpass\n         * @property {boolean=} injectDefaultRoutes\n         * @property {string[]=} headers\n         * @property {number=} maxAge\n         * @property {(string | CustomRoute)[]=} routes\n         */\n        {\n          model: 'reviews',\n          headers: ['accept-language']\n          maxAge: 1000000,\n          routes: [\n            '/reviews/:slug',\n            '/reviews/:id/custom-route',\n            { path: '/reviews/:slug', method: 'DELETE' },\n          ]\n        },\n      ]\n    }\n  }\n});\n```\n\nRunning the CMS should now show the following\n\n```\n$ strapi develop\n[2021-02-26T07:03:18.981Z] info [cache] Mounting LRU cache middleware\n[2021-02-26T07:03:18.982Z] info [cache] Storage engine: mem\n[2021-02-26T07:03:18.985Z] debug [cache] Register review routes middlewares\n[2021-02-26T07:03:18.986Z] debug [cache] POST /reviews purge\n[2021-02-26T07:03:18.987Z] debug [cache] DELETE /reviews/:id purge\n[2021-02-26T07:03:18.987Z] debug [cache] PUT /reviews/:id purge\n[2021-02-26T07:03:18.987Z] debug [cache] GET /reviews recv maxAge=1000000 vary=accept-language\n[2021-02-26T07:03:18.988Z] debug [cache] GET /reviews/:id recv maxAge=1000000 vary=accept-language\n[2021-02-26T07:03:18.988Z] debug [cache] GET /reviews/count recv maxAge=1000000 vary=accept-language\n[2021-02-26T07:03:18.990Z] debug [cache] GET /reviews/:slug maxAge=1000000 vary=accept-language\n[2021-02-26T07:03:18.990Z] debug [cache] GET /reviews/:id/custom-route maxAge=1000000 vary=accept-language\n[2021-02-26T07:03:18.990Z] debug [cache] DELETE /reviews/:slug purge\n```\n\n## Single types\n\nBy default, the middleware assumes that the specified models are collections. Meaning that having `'post'` or `'posts'` in your configuration will result in the `/posts/*` being cached. Pluralization is applied in order to match the Strapi generated endpoints.\n\nThat behaviour is however not desired for [single types](https://strapi.io/blog/beta-19-single-types-uid-field) such as `homepage` which should remain singular in the endpoint (`/homepage`)\n\nYou can mark a specific model as being a single type by using the `singleType` boolean field on model configurations\n\ne.g\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      models: [\n        {\n          model: 'footer',\n          singleType: true,\n        }\n      ]\n    }\n  }\n});\n```\n\nRunning the CMS should now show the following\n\n```\n$ strapi develop\n[2021-02-26T07:03:18.981Z] info [cache] Mounting LRU cache middleware\n[2021-02-26T07:03:18.982Z] info [cache] Storage engine: mem\n[2021-02-26T07:03:18.985Z] debug [cache] Register review routes middlewares\n[2021-02-26T07:03:18.986Z] debug [cache] PUT /footer purge\n[2021-02-26T07:03:18.987Z] debug [cache] DELETE /footer purge\n[2021-02-26T07:03:18.987Z] debug [cache] GET /review recv maxAge=3600000\n```\n\n\n## Authentication\n\nBy default, cache is not looked up if `Authorization` or `Cookie` header are present.\nTo dissable this behaviour add `hitpass: false` to the model cache configuration\n\nYou can customize event further with a function `hitpass: (ctx) => true` where `ctx` is the koa context of the request. Keep in mind that this function is executed before every `recv` requests.\n\ne.g\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      models: [\n        {\n          model: 'footer',\n          hitpass: false,\n          singleType: true,\n        }\n      ]\n    }\n  }\n});\n```\n\n## Etag support\n\nBy setting the `enableEtagSupport` to `true`, the middleware will automatically create an Etag for each payload it caches.\n\nFurther requests sent with the `If-None-Match` header will be returned a `304 Not Modified` status if the content for that url has not changed.\n\n## Clearing related cache\n\nBy setting the `clearRelatedCache` to `true`, the middleware will inspect the Strapi models before a cache clearing operation to locate models that have relations with the queried model so that their cache is also cleared (this clears the whole cache for the related models). The ispection is performed by looking for direct relations between models and also by doing a deep dive in components, looking for relations to the queried model there too.\n\n## Cache entry point\n\n### Koa Context\n\nBy setting the `populateContext` configuration to `true`, the middleware will extend the Koa Context with an entry point which can be used to clear the cache from within controllers\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      populateContext: true,\n      models: ['post']\n    }\n  }\n});\n\n// controller\n\nmodule.exports = {\n  async index(ctx) {\n    ctx.middleware.cache // A direct access to the Cache API\n  }\n};\n```\n\n**IMPORTANT**: We do not recommend using this unless truly necessary. It is disabled by default as it goes against the non-intrusive/transparent nature of this middleware.\n\n### Strapi Middleware\n\nBy setting the `populateStrapiMiddleware` configuration to `true`, the middleware will extend the Strapi middleware object with an entry point which can be used to clear the cache from anywhere (e.g., inside a Model's lifecycle hook where `ctx` is not available).\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      populateStrapiMiddleware: true,\n      models: ['post']\n    }\n  }\n});\n\n// model\n\nmodule.exports = {\n  lifecycles: {\n    async beforeUpdate(params, data) {\n      strapi.middleware.cache // A direct access to the Cache API\n    }\n  }\n};\n```\n\n**IMPORTANT**: We do not recommend using this unless truly necessary. It is disabled by default as it goes against the non-intrusive/transparent nature of this middleware.\n\n## Cache API\n\n```javascript \nconst cache = {\n /**\n  * @typedef {Object} CacheStore\n  * @property {function(string): any} get\n  * @property {function(string): any} peek\n  * @property {function(string, any, number?): boolean} set\n  * @property {function(string): void} del\n  * @property {function(): any[]} keys\n  * @property {function(): void} reset\n  */\n  store,\n\n  /**\n   * @typedef {Object} MiddlewareCacheConfig\n   * @property {'mem'|'redis'} type\n   * @property {boolean} enabled\n   * @property {boolean} logs\n   * @property {boolean} populateContext\n   * @property {boolean} populateStrapiMiddleware\n   * @property {boolean} enableEtagSupport\n   * @property {boolean} enableXCacheHeaders\n   * @property {boolean} clearRelatedCache\n   * @property {boolean} withKoaContext\n   * @property {boolean} withStrapiMiddleware\n   * @property {number} max\n   * @property {number} maxAge\n   * @property {number} cacheTimeout\n   * @property {string[]} headers\n   * @property {ModelCacheConfig[]} models\n   * @property {Object=} redisConfig\n   */\n  options,\n\n  /**\n   * Clear cache with uri parameters\n   * \n   * @param {ModelCacheConfig} cacheConf\n   * @param {{ [key: string]: string; }=} params\n   */\n  clearCache,\n\n  /**\n   * Get related ModelCacheConfig\n   *\n   * @param {string} model\n   * @param {string=} plugin\n   * @returns {ModelCacheConfig=}\n   */\n  getCacheConfig,\n\n  /**\n   * Get related ModelCacheConfig with an uid\n   * \n   * uid:\n   * - application::sport.sport\n   * - plugins::users-permissions.user\n   *\n   * @param {string} uid\n   * @returns {ModelCacheConfig=}\n   */\n  getCacheConfigByUid,\n\n  /**\n   * Get models uid that is related to a ModelCacheConfig\n   *\n   * @param {ModelCacheConfig} cacheConf The model used to find related caches to purge\n   * @return {string[]} Array of related models uid\n   */\n  getRelatedModelsUid,\n\n  /**\n   * Get regexs to match all ModelCacheConfig keys with given params\n   * \n   * @param {ModelCacheConfig} cacheConf\n   * @param {{ [key: string]: string; }=} params\n   * @param {boolean=} wildcard\n   * @returns {RegExp[]}\n   */\n  getCacheConfRegExp,\n\n  /**\n   * Get regexs to match CustomRoute keys with given params\n   *\n   * @param {CustomRoute} route\n   * @param {{ [key: string]: string; }=} params\n   * @param {boolean=} wildcard\n   * @returns {RegExp[]}\n   */\n  getRouteRegExp,\n};\n```\n\n## Admin panel interactions\n\nThe strapi admin panel uses a separate rest api to apply changes to records, e.g `/content-manager/explorer/application::post.post` the middleware will also watch for write operations on that endpoint and bust the cache accordingly\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@2.0.1-beta.2","_nodeVersion":"14.15.5","_npmVersion":"6.14.11","dist":{"integrity":"sha512-8F0hB3smBdq2z68KomZOWI3NxqlpN1koqcBc8wAks2gpT2V9eMhkHdVrSLl0JqND77WCVZ6FQOXU9RNvsh5ozA==","shasum":"a3b1b5c41fa0e154f58fef9739753cb8a4cb0156","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-2.0.1-beta.2.tgz","fileCount":13,"unpackedSize":58895,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOiurCRA9TVsSAnZWagAANiYP/itKBZ7ecFQdfvK80Jo5\non5oATjj7AHm+7A6D6p5mJM41jBcethBi6QnVtjFVdFxttQ7IFRwnpcijD85\nrEAJ2IzyMhnLqW8RmOoLJYs17pGei92TNWV8u3jWD072Y7viYes9UAVwibo3\n8WBeKgl3HewmYDhgQgq0S12cCRJ0kczq1hHgmRpzCO0KgUnPbvX84F6W6fNQ\n3kqv02mDJMuUrNPUhgmrUr6eFIZ0YQOlrd67nPQXBBba/PZuhrWjVd7naugR\nF9Zk1COqImiRjwfJUJSJPOmIhPwnOqjOYVg/TVUmIPraWgb0BOYHeutQSRyJ\nuE5T7HeG3d6VHM/71/NW1uhfDA1n+DaJMnxTFiltrmSt/BJsipkAJHj4zWIo\ntq9/8hzWIkv4iJHFkU9SuOOmQ461bR/YzCIhvtd+6GPUyLJRzEceWYlJPugc\nsDj9gy+U+6Xp+AjIDub74V7c5aK51S1LBrBKjXb8tZUSlKsM0FkOhyry6bK5\nHJCBS4EQJns6RKGbtYKFpgR2o0aL1I+XbAo4IV5VcKAAlQ5g0q9U9FmLKl/g\nrjRVmzOwNfxCEHaFN6bFYMdZ5am6yW1JyXNLe7SAMlOvDpjlYAAkFsYaACdF\n71mlwsTKTnTtSofQAjD675Pie4tyAu+iciWoZUVnZ1HhIZR9zdMBcXEq6Ill\nKAjf\r\n=yNB8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDO1+wO2CsdzPWrssLQUTMxLp/PSddViSbFTiX2JIZqnQIgWEaFkFWIw3eWdNAL/iL72/SOntqLUuQ+6VA0FJhyxVQ="}]},"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"maintainers":[{"name":"patrixr","email":"patrick.rabier@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_2.0.1-beta.2_1614425002843_0.12873568042914352"},"_hasShrinkwrap":false},"2.1.0":{"name":"strapi-middleware-cache","version":"2.1.0","description":"Cache strapi requests","main":"./lib","scripts":{"eslint":"eslint .","eslint:fix":"eslint . --fix","prettier":"prettier --check .","prettier:fix":"prettier --write .","lint":"run-s eslint:fix prettier:fix","test":"run-s test:*","test:lint":"run-s eslint prettier","test:mocha":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"chalk":"^4.1.0","ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","path-to-regexp":"^6.2.0","pluralize":"^8.0.0","redis-lru":"^0.6.0"},"devDependencies":{"@typescript-eslint/parser":"^4.28.4","chai":"^4.2.0","eslint":"^7.31.0","eslint-config-google":"^0.14.0","eslint-config-prettier":"^8.3.0","koa":"^2.11.0","lint-staged":"^11.1.0","mocha":"^7.1.1","npm-run-all":"^4.1.5","prettier":"^2.3.2","sinon":"^9.2.4","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2","typescript":"^4.3.5","yorkie":"^2.0.0"},"peerDependencies":{},"gitHooks":{"pre-commit":"lint-staged"},"lint-staged":{"*.ts":["eslint --fix","prettier --write"],"*.js":["eslint --fix","prettier --write"]},"gitHead":"57b3a1caec1dc8d3b2585d1e09073b1ab26fdc6d","readme":"# Strapi LRU Caching middleware\n\n:warning: You are on beta branch\n\nA cache middleware for the headless CMS strapi.io\n\n![](https://github.com/patrixr/strapi-middleware-cache/workflows/Tests/badge.svg)\n![Maintenance](https://img.shields.io/badge/Maintenance%20-Actively%20Maintained-green.svg)\n\n## How it works\n\nThis middleware caches incoming `GET` requests on the strapi API, based on query params and model ID.\nThe cache is automatically busted everytime a `PUT`, `PATCH`, `POST`, or `DELETE` request comes in.\n\nSupported storage engines\n\n- Memory _(default)_\n- Redis\n\nImportant: Caching must be explicitely enabled **per model**\n\n## Installing\n\nUsing npm\n\n```bash\nnpm install --save strapi-middleware-cache@beta\n```\n\nUsing yarn\n\n```bash\nyarn add strapi-middleware-cache@beta\n```\n\n## Requirements\n\nSince `2.0.1`:\n\n- strapi `3.4.0`\n- node `14`\n\n_See `1.5.0` for strapi < `3.4.0`_\n\n## Setup\n\nFor Strapi stable versions, add a `middleware.js` file within your config folder\n\ne.g\n\n```bash\ntouch config/middleware.js\n```\n\nTo use different settings per environment, see the [Strapi docs for environments](https://strapi.io/documentation/v3.x/concepts/configurations.html#environments).\n\nYou can parse environment variables for the config here as well if you wish to, please see the [Strapi docs for environment variables](https://strapi.io/documentation/v3.x/concepts/configurations.html#environment-variables).\n\nEnable the cache middleware by adding the following snippet to an empty middleware file or simply add in the settings from the below example:\n\n```javascript\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n    },\n  },\n});\n```\n\nStarting the CMS should now log the following\n\n```\n$ strapi develop\n[2021-02-26T07:03:18.981Z] info [cache] Mounting LRU cache middleware\n[2021-02-26T07:03:18.982Z] info [cache] Storage engine: mem\n```\n\n## Configure models\n\nThe middleware will only cache models which have been explicitely enabled.\nAdd a list of models to enable to the module's configuration object.\n\ne.g\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      models: ['review'],\n    },\n  },\n});\n```\n\nStarting the CMS should now log the following\n\n```\n$ strapi develop\n[2021-02-26T07:03:18.981Z] info [cache] Mounting LRU cache middleware\n[2021-02-26T07:03:18.982Z] info [cache] Storage engine: mem\n[2021-02-26T07:03:18.985Z] debug [cache] Register review routes middlewares\n[2021-02-26T07:03:18.986Z] debug [cache] POST /reviews purge\n[2021-02-26T07:03:18.987Z] debug [cache] DELETE /reviews/:id purge\n[2021-02-26T07:03:18.987Z] debug [cache] PUT /reviews/:id purge\n[2021-02-26T07:03:18.987Z] debug [cache] GET /reviews recv maxAge=3600000\n[2021-02-26T07:03:18.988Z] debug [cache] GET /reviews/:id recv maxAge=3600000\n[2021-02-26T07:03:18.988Z] debug [cache] GET /reviews/count recv maxAge=3600000\n```\n\n## Configure the storage engine\n\nThe module's configuration object supports the following properties\n\n### Example\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    /**\n     * @typedef {Object} UserMiddlewareCacheConfig\n     * @property {'mem'|'redis'=} type\n     * @property {boolean=} enabled\n     * @property {boolean=} logs\n     * @property {boolean=} populateContext\n     * @property {boolean=} populateStrapiMiddleware\n     * @property {boolean=} enableEtagSupport\n     * @property {boolean=} enableXCacheHeaders\n     * @property {boolean=} clearRelatedCache\n     * @property {boolean=} withKoaContext\n     * @property {boolean=} withStrapiMiddleware\n     * @property {string[]=} headers\n     * @property {number=} max\n     * @property {number=} maxAge\n     * @property {number=} cacheTimeout\n     * @property {(UserModelCacheConfig | string)[]=} models\n     * @property {Object=} redisConfig\n     */\n    cache: {\n      enabled: true,\n      type: 'redis',\n      models: ['review'],\n      redisConfig: {\n        sentinels: [\n          { host: '192.168.10.41', port: 26379 },\n          { host: '192.168.10.42', port: 26379 },\n          { host: '192.168.10.43', port: 26379 },\n        ],\n        name: 'redis-primary',\n      },\n    },\n  },\n});\n```\n\nRunning the CMS will output the following\n\n```\n$ strapi develop\n[2021-02-26T07:03:18.981Z] info [cache] Mounting LRU cache middleware\n[2021-02-26T07:03:18.982Z] info [cache] Storage engine: mem\n[2021-02-26T07:03:18.985Z] debug [cache] Register review routes middlewares\n[2021-02-26T07:03:18.986Z] debug [cache] POST /reviews purge\n[2021-02-26T07:03:18.987Z] debug [cache] DELETE /reviews/:id purge\n[2021-02-26T07:03:18.987Z] debug [cache] PUT /reviews/:id purge\n[2021-02-26T07:03:18.987Z] debug [cache] GET /reviews recv maxAge=3600000\n[2021-02-26T07:03:18.988Z] debug [cache] GET /reviews/:id recv maxAge=3600000\n[2021-02-26T07:03:18.988Z] debug [cache] GET /reviews/count recv maxAge=3600000\n```\n\n## Per-Model Configuration\n\nEach route can hold its own configuration object for more granular control. This can be done simply\nby replacing the model strings in the list by object.\n\nOn which you can set:\n\n- Its own custom `maxAge`\n- Headers to include in the cache-key (e.g the body may differ depending on the language requested)\n\ne.g\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      type: 'redis',\n      maxAge: 3600000,\n      models: [\n        /**\n         * @typedef {Object} UserModelCacheConfig\n         * @property {string} model\n         * @property {string=} plugin\n         * @property {boolean=} singleType\n         * @property {Hitpass|boolean=} hitpass\n         * @property {boolean=} injectDefaultRoutes\n         * @property {string[]=} headers\n         * @property {number=} maxAge\n         * @property {(string | CustomRoute)[]=} routes\n         */\n        {\n          model: 'reviews',\n          headers: ['accept-language']\n          maxAge: 1000000,\n          routes: [\n            '/reviews/:slug',\n            '/reviews/:id/custom-route',\n            { path: '/reviews/:slug', method: 'DELETE' },\n          ]\n        },\n      ]\n    }\n  }\n});\n```\n\nRunning the CMS should now show the following\n\n```\n$ strapi develop\n[2021-02-26T07:03:18.981Z] info [cache] Mounting LRU cache middleware\n[2021-02-26T07:03:18.982Z] info [cache] Storage engine: mem\n[2021-02-26T07:03:18.985Z] debug [cache] Register review routes middlewares\n[2021-02-26T07:03:18.986Z] debug [cache] POST /reviews purge\n[2021-02-26T07:03:18.987Z] debug [cache] DELETE /reviews/:id purge\n[2021-02-26T07:03:18.987Z] debug [cache] PUT /reviews/:id purge\n[2021-02-26T07:03:18.987Z] debug [cache] GET /reviews recv maxAge=1000000 vary=accept-language\n[2021-02-26T07:03:18.988Z] debug [cache] GET /reviews/:id recv maxAge=1000000 vary=accept-language\n[2021-02-26T07:03:18.988Z] debug [cache] GET /reviews/count recv maxAge=1000000 vary=accept-language\n[2021-02-26T07:03:18.990Z] debug [cache] GET /reviews/:slug maxAge=1000000 vary=accept-language\n[2021-02-26T07:03:18.990Z] debug [cache] GET /reviews/:id/custom-route maxAge=1000000 vary=accept-language\n[2021-02-26T07:03:18.990Z] debug [cache] DELETE /reviews/:slug purge\n```\n\n## Single types\n\nBy default, the middleware assumes that the specified models are collections. Meaning that having `'post'` or `'posts'` in your configuration will result in the `/posts/*` being cached. Pluralization is applied in order to match the Strapi generated endpoints.\n\nThat behaviour is however not desired for [single types](https://strapi.io/blog/beta-19-single-types-uid-field) such as `homepage` which should remain singular in the endpoint (`/homepage`)\n\nYou can mark a specific model as being a single type by using the `singleType` boolean field on model configurations\n\ne.g\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      models: [\n        {\n          model: 'footer',\n          singleType: true,\n        },\n      ],\n    },\n  },\n});\n```\n\nRunning the CMS should now show the following\n\n```\n$ strapi develop\n[2021-02-26T07:03:18.981Z] info [cache] Mounting LRU cache middleware\n[2021-02-26T07:03:18.982Z] info [cache] Storage engine: mem\n[2021-02-26T07:03:18.985Z] debug [cache] Register review routes middlewares\n[2021-02-26T07:03:18.986Z] debug [cache] PUT /footer purge\n[2021-02-26T07:03:18.987Z] debug [cache] DELETE /footer purge\n[2021-02-26T07:03:18.987Z] debug [cache] GET /review recv maxAge=3600000\n```\n\n## Authentication\n\nBy default, cache is not looked up if `Authorization` or `Cookie` header are present.\nTo dissable this behaviour add `hitpass: false` to the model cache configuration\n\nYou can customize event further with a function `hitpass: (ctx) => true` where `ctx` is the koa context of the request. Keep in mind that this function is executed before every `recv` requests.\n\ne.g\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      models: [\n        {\n          model: 'footer',\n          hitpass: false,\n          singleType: true,\n        },\n      ],\n    },\n  },\n});\n```\n\n## Etag support\n\nBy setting the `enableEtagSupport` to `true`, the middleware will automatically create an Etag for each payload it caches.\n\nFurther requests sent with the `If-None-Match` header will be returned a `304 Not Modified` status if the content for that url has not changed.\n\n## Clearing related cache\n\nBy setting the `clearRelatedCache` to `true`, the middleware will inspect the Strapi models before a cache clearing operation to locate models that have relations with the queried model so that their cache is also cleared (this clears the whole cache for the related models). The ispection is performed by looking for direct relations between models and also by doing a deep dive in components, looking for relations to the queried model there too.\n\n## Cache entry point\n\n### Koa Context\n\nBy setting the `populateContext` configuration to `true`, the middleware will extend the Koa Context with an entry point which can be used to clear the cache from within controllers\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      populateContext: true,\n      models: ['post'],\n    },\n  },\n});\n\n// controller\n\nmodule.exports = {\n  async index(ctx) {\n    ctx.middleware.cache; // A direct access to the Cache API\n  },\n};\n```\n\n**IMPORTANT**: We do not recommend using this unless truly necessary. It is disabled by default as it goes against the non-intrusive/transparent nature of this middleware.\n\n### Strapi Middleware\n\nBy setting the `populateStrapiMiddleware` configuration to `true`, the middleware will extend the Strapi middleware object with an entry point which can be used to clear the cache from anywhere (e.g., inside a Model's lifecycle hook where `ctx` is not available).\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      populateStrapiMiddleware: true,\n      models: ['post'],\n    },\n  },\n});\n\n// model\n\nmodule.exports = {\n  lifecycles: {\n    async beforeUpdate(params, data) {\n      strapi.middleware.cache; // A direct access to the Cache API\n    },\n  },\n};\n```\n\n**IMPORTANT**: We do not recommend using this unless truly necessary. It is disabled by default as it goes against the non-intrusive/transparent nature of this middleware.\n\n## Cache API\n\n```javascript\nconst cache = {\n  /**\n   * @typedef {Object} CacheStore\n   * @property {function(string): any} get\n   * @property {function(string): any} peek\n   * @property {function(string, any, number?): boolean} set\n   * @property {function(string): void} del\n   * @property {function(): any[]} keys\n   * @property {function(): void} reset\n   */\n  store,\n\n  /**\n   * @typedef {Object} MiddlewareCacheConfig\n   * @property {'mem'|'redis'} type\n   * @property {boolean} enabled\n   * @property {boolean} logs\n   * @property {boolean} populateContext\n   * @property {boolean} populateStrapiMiddleware\n   * @property {boolean} enableEtagSupport\n   * @property {boolean} enableXCacheHeaders\n   * @property {boolean} clearRelatedCache\n   * @property {boolean} withKoaContext\n   * @property {boolean} withStrapiMiddleware\n   * @property {number} max\n   * @property {number} maxAge\n   * @property {number} cacheTimeout\n   * @property {string[]} headers\n   * @property {ModelCacheConfig[]} models\n   * @property {Object=} redisConfig\n   */\n  options,\n\n  /**\n   * Clear cache with uri parameters\n   *\n   * @param {ModelCacheConfig} cacheConf\n   * @param {{ [key: string]: string; }=} params\n   */\n  clearCache,\n\n  /**\n   * Get related ModelCacheConfig\n   *\n   * @param {string} model\n   * @param {string=} plugin\n   * @returns {ModelCacheConfig=}\n   */\n  getCacheConfig,\n\n  /**\n   * Get related ModelCacheConfig with an uid\n   *\n   * uid:\n   * - application::sport.sport\n   * - plugins::users-permissions.user\n   *\n   * @param {string} uid\n   * @returns {ModelCacheConfig=}\n   */\n  getCacheConfigByUid,\n\n  /**\n   * Get models uid that is related to a ModelCacheConfig\n   *\n   * @param {ModelCacheConfig} cacheConf The model used to find related caches to purge\n   * @return {string[]} Array of related models uid\n   */\n  getRelatedModelsUid,\n\n  /**\n   * Get regexs to match all ModelCacheConfig keys with given params\n   *\n   * @param {ModelCacheConfig} cacheConf\n   * @param {{ [key: string]: string; }=} params\n   * @param {boolean=} wildcard\n   * @returns {RegExp[]}\n   */\n  getCacheConfRegExp,\n\n  /**\n   * Get regexs to match CustomRoute keys with given params\n   *\n   * @param {CustomRoute} route\n   * @param {{ [key: string]: string; }=} params\n   * @param {boolean=} wildcard\n   * @returns {RegExp[]}\n   */\n  getRouteRegExp,\n};\n```\n\n## Admin panel interactions\n\nThe strapi admin panel uses a separate rest api to apply changes to records, e.g `/content-manager/explorer/application::post.post` the middleware will also watch for write operations on that endpoint and bust the cache accordingly\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@2.1.0","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-oQ0DO2yOaqFLzQZK2a3NiNByYaGWRlv4oXsXElkF62kKfYr2/Y8u/hqptN8dnVs10WR2eADiOXAqCKcXjKYu/w==","shasum":"f09a4ea3e570848910dcfcd023ce07f26b773b4b","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-2.1.0.tgz","fileCount":35,"unpackedSize":65034,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTgQGHTX+mCEKv1OhZ1ziitHx8QJlQ6exRX3qVcnv/WAIgKiofoCVupzw5RGuK6VSWqyqtCs6LkRWrHPTQVF3zVt0="}]},"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"maintainers":[{"name":"patrixr","email":"patrick.rabier@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_2.1.0_1634258869427_0.30846644090443265"},"_hasShrinkwrap":false},"1.5.1":{"name":"strapi-middleware-cache","version":"1.5.1","description":"Cache strapi requests","main":"./lib","scripts":{"test":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","pluralize":"^8.0.0","redis-lru":"^0.6.0","semver":"^7.3.4"},"devDependencies":{"chai":"^4.2.0","koa":"^2.11.0","mocha":"^7.1.1","sinon":"^9.2.4","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2"},"gitHead":"8c161871fdd5c5c6deb54fc12101e8a003a68ee2","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@1.5.1","_nodeVersion":"12.22.6","_npmVersion":"6.14.15","dist":{"integrity":"sha512-9JOhLspCM1mk8rt1PLMMT92aJq9fbJFDn1MngTtaYV019EauMkoqQaL7ikQ7cLYnfQWEUMIsM+kyhOit7YsMHw==","shasum":"9b94f8ac0e61ad04e30f04fabe0ad68cf60427ce","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-1.5.1.tgz","fileCount":13,"unpackedSize":41310,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCmtdeo/kC+gxa/q+SiizROoYJhd8RVcVWezUdoHsp1pgIhAOyUE4sci6ZXQ1V/ESvMFn2bdcnPWxse0RAEnOF29wyC"}]},"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"maintainers":[{"name":"patrixr","email":"patrick.rabier@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_1.5.1_1634438453130_0.3426587745010832"},"_hasShrinkwrap":false},"2.1.1":{"name":"strapi-middleware-cache","version":"2.1.1","description":"Cache strapi requests","main":"./lib","scripts":{"eslint":"eslint .","eslint:fix":"eslint . --fix","prettier":"prettier --check .","prettier:fix":"prettier --write .","lint":"run-s eslint:fix prettier:fix","test":"run-s test:*","test:lint":"run-s eslint prettier","test:mocha":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"chalk":"^4.1.0","ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","path-to-regexp":"^6.2.0","pluralize":"^8.0.0","redis-lru":"^0.6.0"},"devDependencies":{"@typescript-eslint/parser":"^4.28.4","chai":"^4.2.0","eslint":"^7.31.0","eslint-config-google":"^0.14.0","eslint-config-prettier":"^8.3.0","koa":"^2.11.0","lint-staged":"^11.1.0","mocha":"^7.1.1","npm-run-all":"^4.1.5","prettier":"^2.3.2","sinon":"^9.2.4","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2","typescript":"^4.3.5","yorkie":"^2.0.0"},"peerDependencies":{},"gitHooks":{"pre-commit":"lint-staged"},"lint-staged":{"*.ts":["eslint --fix","prettier --write"],"*.js":["eslint --fix","prettier --write"]},"gitHead":"298c5b06aa1d9c86dfb1cdb7f53d7b54e4d9acc1","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@2.1.1","_nodeVersion":"12.22.6","_npmVersion":"6.14.15","dist":{"integrity":"sha512-gzHAlpNcQ5ujmZQ+zlIieV/xZqWb8ICvcuL0dq42CEGCht55XcuHuXYMVLlL6DhAqYK7C3p2v1643XgCj3u8mg==","shasum":"9b9d587a0fd96f5f006849978a79a130ed7e868a","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-2.1.1.tgz","fileCount":35,"unpackedSize":66050,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICiRDr8pp5fBfv4caffKehJDorLTtotffoacixA7bRJDAiAhRVYoSBpyuvGn93lKE5tdIenb5swMh9Gt4furzgfPZg=="}]},"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"maintainers":[{"name":"patrixr","email":"patrick.rabier@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_2.1.1_1634611642376_0.319451644584827"},"_hasShrinkwrap":false},"2.1.2":{"name":"strapi-middleware-cache","version":"2.1.2","description":"Cache strapi requests","main":"./lib","scripts":{"eslint":"eslint .","eslint:fix":"eslint . --fix","prettier":"prettier --check .","prettier:fix":"prettier --write .","lint":"run-s eslint:fix prettier:fix","test":"run-s test:*","test:lint":"run-s eslint prettier","test:mocha":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"chalk":"^4.1.0","ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","path-to-regexp":"^6.2.0","pluralize":"^8.0.0","redis-lru":"^0.6.0"},"devDependencies":{"@typescript-eslint/parser":"^4.28.4","chai":"^4.2.0","eslint":"^7.31.0","eslint-config-google":"^0.14.0","eslint-config-prettier":"^8.3.0","koa":"^2.11.0","lint-staged":"^11.1.0","mocha":"^7.1.1","npm-run-all":"^4.1.5","prettier":"^2.3.2","sinon":"^9.2.4","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2","typescript":"^4.3.5","yorkie":"^2.0.0"},"peerDependencies":{},"gitHooks":{"pre-commit":"lint-staged"},"lint-staged":{"*.ts":["eslint --fix","prettier --write"],"*.js":["eslint --fix","prettier --write"]},"gitHead":"195a5a27f364b3ee385b6d45f29d0defb2904516","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@2.1.2","_nodeVersion":"12.22.7","_npmVersion":"6.14.15","dist":{"integrity":"sha512-1+vFwA2urxJkkhdhK4gB1nTasR0XyoVW4F+4D2UJ8B9THjC5sTKynFue3K+TOzcSQ4c1KYJbbl+oXT2myFtfLA==","shasum":"1fa8729967e831e41a0c2d3ed6350448a03621f2","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-2.1.2.tgz","fileCount":35,"unpackedSize":66030,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvgPlaMmMVpCB0v0mpWoaxB2TkCaav1SG9sK3TZfRoLAIgFh5bhCWhOFH5TVBnTuCBruQb9Maeoysryv7RjWpCPKU="}]},"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"maintainers":[{"name":"patrixr","email":"patrick.rabier@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_2.1.2_1634900172742_0.407420520113734"},"_hasShrinkwrap":false},"2.1.3":{"name":"strapi-middleware-cache","version":"2.1.3","description":"Cache strapi requests","main":"./lib","scripts":{"eslint":"eslint .","eslint:fix":"eslint . --fix","prettier":"prettier --check .","prettier:fix":"prettier --write .","lint":"run-s eslint:fix prettier:fix","test":"run-s test:*","test:lint":"run-s eslint prettier","test:mocha":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"chalk":"^4.1.0","ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","path-to-regexp":"^6.2.0","pluralize":"^8.0.0","redis-lru":"^0.6.0"},"devDependencies":{"@typescript-eslint/parser":"^4.28.4","chai":"^4.2.0","eslint":"^7.31.0","eslint-config-google":"^0.14.0","eslint-config-prettier":"^8.3.0","koa":"^2.11.0","lint-staged":"^11.1.0","mocha":"^7.1.1","npm-run-all":"^4.1.5","prettier":"^2.3.2","sinon":"^9.2.4","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2","typescript":"^4.3.5","yorkie":"^2.0.0"},"peerDependencies":{},"gitHooks":{"pre-commit":"lint-staged"},"lint-staged":{"*.ts":["eslint --fix","prettier --write"],"*.js":["eslint --fix","prettier --write"]},"gitHead":"ebf81bec6447d399182b897e59fc1d6b7bc1f887","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@2.1.3","_nodeVersion":"12.22.7","_npmVersion":"6.14.15","dist":{"integrity":"sha512-csSUQb0aILhp6LpDZ0/QeHkRQ+i4f3JvCrIK+NpvlmNt20WuRU4INP4avDPZ+2jhk9EklvKlqcXGS3gekTsL5g==","shasum":"94153c8801cb7dae5936746b74344c47e6c43151","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-2.1.3.tgz","fileCount":35,"unpackedSize":65977,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCXgrUjno81jRRFba0wQXz3IkeKo9nyLxllzt+NdFtDtAIgZACmwUys7TmoLg9cC5rFb5X1W83pEuMQ5LcNm59AiJ4="}]},"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"maintainers":[{"name":"patrixr","email":"patrick.rabier@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_2.1.3_1634988822863_0.19670059014742813"},"_hasShrinkwrap":false},"2.1.4":{"name":"strapi-middleware-cache","version":"2.1.4","description":"Cache strapi requests","main":"./lib","scripts":{"eslint":"eslint .","eslint:fix":"eslint . --fix","prettier":"prettier --check .","prettier:fix":"prettier --write .","lint":"run-s eslint:fix prettier:fix","test":"run-s test:*","test:lint":"run-s eslint prettier","test:mocha":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"chalk":"^4.1.0","ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","path-to-regexp":"^6.2.0","pluralize":"^8.0.0","redis-lru":"^0.6.0"},"devDependencies":{"@typescript-eslint/parser":"^4.28.4","chai":"^4.2.0","eslint":"^7.31.0","eslint-config-google":"^0.14.0","eslint-config-prettier":"^8.3.0","koa":"^2.11.0","lint-staged":"^11.1.0","mocha":"^7.1.1","npm-run-all":"^4.1.5","prettier":"^2.3.2","sinon":"^9.2.4","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2","typescript":"^4.3.5","yorkie":"^2.0.0"},"peerDependencies":{},"gitHooks":{"pre-commit":"lint-staged"},"lint-staged":{"*.ts":["eslint --fix","prettier --write"],"*.js":["eslint --fix","prettier --write"]},"gitHead":"9df8ecc9b460975191f49cd1816d9a6eedae94bf","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@2.1.4","_nodeVersion":"12.22.7","_npmVersion":"6.14.15","dist":{"integrity":"sha512-mgPRnYFlWFcK6+7Gktiw/0yGx5uXBuq5A+PmxRYhAovKrfU6php0Rzk7oWmpGDVci1VoqCXD3tFbyhkqcTPRZg==","shasum":"d5765958366391e6fd0cf66b4afbb9dbcbec8cfc","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-2.1.4.tgz","fileCount":35,"unpackedSize":66141,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHYzcayAvptcemfNKkG51Zz9tC3kjMlz9jdGk6McRuDMAiEAj7PzdgIMTFWfC3I6h2VNvdOIUn2L6UEi7++uwHgTDvc="}]},"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"maintainers":[{"name":"patrixr","email":"patrick.rabier@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_2.1.4_1635235231080_0.4144159592623138"},"_hasShrinkwrap":false},"2.1.5":{"name":"strapi-middleware-cache","version":"2.1.5","description":"Cache strapi requests","main":"./lib","types":"./types","scripts":{"eslint":"eslint .","eslint:fix":"eslint . --fix","prettier":"prettier --check .","prettier:fix":"prettier --write .","lint":"run-s eslint:fix prettier:fix","test":"run-s test:*","test:tsc":"tsc","test:lint":"run-s eslint prettier","test:mocha":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib","types":"./types"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"chalk":"^4.1.0","ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","path-to-regexp":"^6.2.0","pluralize":"^8.0.0","redis-lru":"^0.6.0"},"devDependencies":{"@types/ioredis":"^4.27.8","@types/koa":"^2.13.4","@types/koa-router":"^7.4.4","@types/lodash":"^4.14.176","@types/lru-cache":"^5.1.1","@types/pluralize":"^0.0.29","@typescript-eslint/eslint-plugin":"^5.2.0","@typescript-eslint/parser":"^5.2.0","babel-eslint":"^10.1.0","chai":"^4.2.0","eslint":"^7.31.0","eslint-config-google":"^0.14.0","eslint-config-prettier":"^8.3.0","eslint-plugin-jsdoc":"^37.0.3","koa":"^2.11.0","lint-staged":"^11.1.0","mocha":"^7.1.1","npm-run-all":"^4.1.5","prettier":"^2.3.2","sinon":"^9.2.4","strapi-supercharged":"0.3.2","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2","typescript":"^4.3.5","yorkie":"^2.0.0"},"peerDependencies":{},"gitHooks":{"pre-commit":"lint-staged"},"lint-staged":{"*.ts":["eslint --fix","prettier --write"],"*.js":["eslint --fix","prettier --write"]},"gitHead":"5640e368e074fc9274c26188d303f8651c55a924","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@2.1.5","_nodeVersion":"12.22.7","_npmVersion":"6.14.15","dist":{"integrity":"sha512-ewN6RCX6MWWwo+farx8XA+q/AdFP7mEBM2eouwZ8xKugrk5yjranamM0IuI6aIuaWCE77EFiFSVzsBp9KDu9rQ==","shasum":"ccaccbbc9c48ce30c0396c029095f8afa74ebf87","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-2.1.5.tgz","fileCount":39,"unpackedSize":72396,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCy+HYWg6cICJ8hdjT96PlmNdOH3g8qMf8CFidA9KoaiQIgNKLO/kVB9KWlVQb9YUhue1/f2OSXB34MEy4iAstlbd4="}]},"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"maintainers":[{"name":"patrixr","email":"patrick.rabier@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_2.1.5_1635381590987_0.02333168060119717"},"_hasShrinkwrap":false},"2.1.6":{"name":"strapi-middleware-cache","version":"2.1.6","description":"Cache strapi requests","main":"./lib","types":"./types","scripts":{"eslint":"eslint .","eslint:fix":"eslint . --fix","prettier":"prettier --check .","prettier:fix":"prettier --write .","lint":"run-s eslint:fix prettier:fix","test":"run-s test:*","test:tsc":"tsc","test:lint":"run-s eslint prettier","test:mocha":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib","types":"./types"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"chalk":"^4.1.0","ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","path-to-regexp":"^6.2.0","pluralize":"^8.0.0","redis-lru":"^0.6.0"},"devDependencies":{"@types/ioredis":"^4.27.8","@types/koa":"^2.13.4","@types/koa-router":"^7.4.4","@types/lodash":"^4.14.176","@types/lru-cache":"^5.1.1","@types/pluralize":"^0.0.29","@typescript-eslint/eslint-plugin":"^5.2.0","@typescript-eslint/parser":"^5.2.0","babel-eslint":"^10.1.0","chai":"^4.2.0","eslint":"^7.31.0","eslint-config-google":"^0.14.0","eslint-config-prettier":"^8.3.0","eslint-plugin-jsdoc":"^37.0.3","koa":"^2.11.0","lint-staged":"^11.1.0","mocha":"^7.1.1","npm-run-all":"^4.1.5","prettier":"^2.3.2","sinon":"^9.2.4","strapi-supercharged":"0.3.2","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2","typescript":"^4.3.5","yorkie":"^2.0.0"},"peerDependencies":{},"gitHooks":{"pre-commit":"lint-staged"},"lint-staged":{"*.ts":["eslint --fix","prettier --write"],"*.js":["eslint --fix","prettier --write"]},"gitHead":"991b401ebddfc37f5309a3db458d1e41922b7c18","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@2.1.6","_nodeVersion":"12.22.7","_npmVersion":"6.14.15","dist":{"integrity":"sha512-DSU4qZe0jEfdl2Sh1RPGvtcvSumJEE9Kr32o2I4J7LnNsPVA+ir5YYnbBVYEEypP8C0VrO0l7rqfzbKVjBhvCw==","shasum":"85bd21d0259d0021f31f2437d3457a96f25472e0","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-2.1.6.tgz","fileCount":39,"unpackedSize":72380,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhszcbCRA9TVsSAnZWagAAwucP/RkxkyCSHBWckOJxm7Da\nSV+I2u1LqLMOazfEe3tTohg0oZ9qZUzm9X9hTGRE5kWN7pYsQuKhR4wHxBAb\n2mTGPmJa44XlVJk/fXWQ0GOtgpSLXVt3Z6EOHl1mSKRCmPIUnLD9rrTzGvu1\nfZKeaJvfI2tHnbXysM2zEYMkwoq/GAr6Qp4djN6befijnt5aAAWaeplffIWl\n4NWtuxeb8EUgp1ySOFxKSZHp49QarS2aFASdWv6G9HWsTmj6/f0XW25Kj5yK\n9jjxZ/uZaBkjvoe1J7SCWnxAGxRkz55uNOhXAmsHf8vVGqOB5RXtZrHlpd4h\nSGchtbywL2Cj7HdG7ew8lsgn7pF4Kf2J8Pfczr4rsmrjrs9ubhEzZaSFwHDT\nS+HHZowN+W0bCIhY/Y3HWycIXyhDAzTBlYZ4CQ2hVYHb7iWydxb3WY8If8G/\nRMJTKgN2rc2cIVEREr97UN1pkG0NhEV8FJLd41+AykQzn68YJE98qNnOYESK\nWhN2ZanPZNnSTMKhJZqU7CRkSfGjhfUDnlqF3oQFbQw8oobrG3WySwUz2Nda\nk7vN2vcIh8kFZwV5rkdwci0+qCQbhGd7tujztpmOUHe6ZVPb7RNPsobE9OjP\nL/CGx/JkWLRYTM5VPnQ8aTSotOgwvgn65gJ6cO0a/uknOYCU8wCjwYxL11Hk\n+1xN\r\n=kzhJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDx+SpD6xI+vqTz16+m5/tLiDO3VqlsTHZyS4ppMC4P7gIhAPQo/DZ1z+K4mxBEnGFZgiGgokZCfDcw3UN3LFn6sxfx"}]},"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"maintainers":[{"name":"patrixr","email":"patrick.rabier@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_2.1.6_1639135003320_0.010597501320509739"},"_hasShrinkwrap":false},"2.1.7":{"name":"strapi-middleware-cache","version":"2.1.7","description":"Cache strapi requests","main":"./lib","types":"./types","scripts":{"eslint":"eslint .","eslint:fix":"eslint . --fix","prettier":"prettier --check .","prettier:fix":"prettier --write .","lint":"run-s eslint:fix prettier:fix","test":"run-s test:*","test:tsc":"tsc","test:lint":"run-s eslint prettier","test:mocha":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib","types":"./types"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"chalk":"^4.1.0","ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","path-to-regexp":"^6.2.0","pluralize":"^8.0.0","redis-lru":"^0.6.0"},"devDependencies":{"@types/ioredis":"^4.27.8","@types/koa":"^2.13.4","@types/koa-router":"^7.4.4","@types/lodash":"^4.14.176","@types/lru-cache":"^5.1.1","@types/pluralize":"^0.0.29","@typescript-eslint/eslint-plugin":"^5.2.0","@typescript-eslint/parser":"^5.2.0","babel-eslint":"^10.1.0","chai":"^4.2.0","eslint":"^7.31.0","eslint-config-google":"^0.14.0","eslint-config-prettier":"^8.3.0","eslint-plugin-jsdoc":"^37.0.3","koa":"^2.11.0","lint-staged":"^11.1.0","mocha":"^7.1.1","npm-run-all":"^4.1.5","prettier":"^2.3.2","sinon":"^9.2.4","strapi-supercharged":"0.3.2","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2","typescript":"^4.3.5","yorkie":"^2.0.0"},"peerDependencies":{},"gitHooks":{"pre-commit":"lint-staged"},"lint-staged":{"*.ts":["eslint --fix","prettier --write"],"*.js":["eslint --fix","prettier --write"]},"gitHead":"1c403ad78f4b26444465b143633c525848ed7f8b","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@2.1.7","_nodeVersion":"12.22.7","_npmVersion":"6.14.15","dist":{"integrity":"sha512-KbUyXoXiCerJB5m3N7zsjbPo6WMVOwqojo65oztFLEBHShBsLWkHRPv6n5AeobN0UBCgN3lqTRvOExTV2uaAVA==","shasum":"c8253825300791fe9698fd4b18df48dee98c6b5b","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-2.1.7.tgz","fileCount":39,"unpackedSize":72396,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhvC8cCRA9TVsSAnZWagAAbaIQAJtPHKtfSDyRP86btZZz\nw2rm9E2LdGFwAwMkzxxjocOZ+wAeDwTD7eygQqHdhlfFQDCpE2/ewUvewvyI\n1sAK6qDgsN+xuzvHqlv4rL4L1Yq+JrEsMT6BatRV/BIaAUZVvx64ozrwuS6T\nKUVrFC3hitb5i1uoUry6VfDWbp1LuZAD95CzB22MfXyWu7c5/ezz/EvqmZX+\nYVH9OwkGKsp73ZlZezLq8S5pELOzXCdgd3poe/15ZXgZsQb9v6xPgYdmdz2X\ns4kzaVPB2f8fl0SIbnKJxRpkWQwicmWvdwROqKDG2Gb2gRfyi4tTqNTz8xIl\n6xwa9snkLCli/CsL+vOElAqo7zgieTuiPNa2YUgs90LNljXBG9wJeV/pvndK\nXC3v5RlLtgsZaKamymRIykv2rJ4PAf/8O2shZdRJXEsTEJ/uFeO3rxZ46Mgv\nnW6IsrqI2EVB43cr2UfFIW4/amaXBw9Ly1XJ/ieoceo3VY2e/GYCr7THdP5x\nK8ujKafzM6S0EIkUkwtVQ4QanhzkBcNus3LpRa9dMO0f1DIp9Qv9TRZ6P0mI\noLb9ul4ykbDVHAOkEP83pgWAZVbO9UZPcmxQnJUYUFjZbqcDbR1zEbmFFLFU\n06pdthlDTzJg9ihPzyGr0VkdBrnFTtaaVhx9wle4LXvGPu/wFI5kZAMwYihU\nUyD2\r\n=WtLF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCSwAgcRck9oihap4RKsIV9m0hDBL9CKFT3P5aelSMTawIhAM4/ZUi7aUM1vP56IEQaAdoRwBtH7yu/U/8yAis7SJHx"}]},"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"maintainers":[{"name":"patrixr","email":"patrick.rabier@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_2.1.7_1639722780569_0.4253736065310447"},"_hasShrinkwrap":false},"2.1.8":{"name":"strapi-middleware-cache","version":"2.1.8","description":"Cache strapi requests","main":"./lib","types":"./types","scripts":{"eslint":"eslint .","eslint:fix":"eslint . --fix","prettier":"prettier --check .","prettier:fix":"prettier --write .","lint":"run-s eslint:fix prettier:fix","test":"run-s test:*","test:tsc":"tsc","test:lint":"run-s eslint prettier","test:mocha":"mocha ./tests/*.test.js --exit"},"keywords":["cache","strapi","requests","redis","memcache"],"directories":{"lib":"./lib","types":"./types"},"repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"author":{"name":"Patrick R"},"license":"MIT","dependencies":{"chalk":"^4.1.0","ioredis":"^4.17.1","koa-router":"^8.0.8","lodash":"^4.17.15","lru-cache":"^5.1.1","path-to-regexp":"^6.2.0","pluralize":"^8.0.0","redis-lru":"^0.6.0"},"devDependencies":{"@types/ioredis":"^4.27.8","@types/koa":"^2.13.4","@types/koa-router":"^7.4.4","@types/lodash":"^4.14.176","@types/lru-cache":"^5.1.1","@types/pluralize":"^0.0.29","@typescript-eslint/eslint-plugin":"^5.2.0","@typescript-eslint/parser":"^5.2.0","babel-eslint":"^10.1.0","chai":"^4.2.0","eslint":"^7.31.0","eslint-config-google":"^0.14.0","eslint-config-prettier":"^8.3.0","eslint-plugin-jsdoc":"^37.0.3","koa":"^2.11.0","lint-staged":"^11.1.0","mocha":"^7.1.1","npm-run-all":"^4.1.5","prettier":"^2.3.2","sinon":"^9.2.4","strapi-supercharged":"0.3.2","supertest":"^4.0.2","supertest-koa-agent":"^0.3.2","typescript":"^4.3.5","yorkie":"^2.0.0"},"peerDependencies":{},"gitHooks":{"pre-commit":"lint-staged"},"lint-staged":{"*.ts":["eslint --fix","prettier --write"],"*.js":["eslint --fix","prettier --write"]},"gitHead":"ac7dd3f1d1ea35cf3f091d8498fc0abe1287653a","bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"},"homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","_id":"strapi-middleware-cache@2.1.8","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-QRHzurX091UMN8EqDh/1lFoBW7OYmhAKJ7l4Q/0Wf1pWNgKaOcSR1SndAt94Wby82cQXcvOP2D505sqd/LimqA==","shasum":"95c70d5b46470245946f0c49cbc0cb8f3d8332fb","tarball":"https://registry.npmjs.org/strapi-middleware-cache/-/strapi-middleware-cache-2.1.8.tgz","fileCount":39,"unpackedSize":73771,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC5eViT1BtZEBdWhZ4m6gokllVmtG8WOnG7AFdBXCe1BAIgY13Fjhlg0jWZgWpDH8qm8rggghhrg0YhWvti82ii2/s="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi3h/XACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpnkBAAh7wyTgt2QPGIsc3jPRv0fUv9LNEWlXsI1NIlzWMHGRWFl0aJ\r\nOboodCUd7MX4pzJ0nqCHFXjOOJbpGHANkeRXjcVSkP+hyVCGBWHyTUuAIWbB\r\nuRPwbGAvi9KmCvWu88PUmABsvXgs2B+rclfdZJc9/O33a9jMrLNm4HVAoEEO\r\nsjjGnkw0wcDWRENB++hKaSw0cke5/CgMu1gSUJlg19qPJg8LTrciCP1Q+s/F\r\nXAb5EHdtAjsu6hCTC6R47ucWDLnVBuV7sNNnq6htCKhQ2gTULgGIAlbBlNKS\r\nw4/6laat+JY2+a5I5YbzeFYYazHuC4/112+xVhk5N9wj02qIo0nRCyO0zj10\r\nRfA7Bn/nbCs8lhrxN6QqqFbo/5mWRgGK1ek3bKuFMT59JNR49r5R5Q2yRAoD\r\n5+sRR3QLjcbwYK0btjQTFod/bz5SHSmHgRZPWXOI/Iw3hFCuy33m/FZCXzkA\r\neTWVkmOW2NTLLwNB4kCzBiJjla9GVm1EsnJbAXyhapmGrqoetm3XF62hpqxo\r\nvw+AXeTPXuxEA18BqDiwyVLcnpuyP2VERA9Ln4t1ByPxuo7jqVM9dJ1ukgSk\r\nj3DCcldY/mW0jctmurl1Ix59oXzqDs888N3RgsDi1e68xMZwMy1kyRPKQqS3\r\nqLJTT1p614rPCaH4xQLqppzn4RSPO4fq2OE=\r\n=e7IX\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"patrixr","email":"patrick.rabier@gmail.com"},"maintainers":[{"name":"patrixr","email":"patrick.rabier@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strapi-middleware-cache_2.1.8_1658724311172_0.05326970086051497"},"_hasShrinkwrap":false}},"time":{"created":"2020-04-14T11:42:37.470Z","1.0.0":"2020-04-14T11:42:37.657Z","modified":"2022-07-25T04:45:11.471Z","1.0.1":"2020-04-14T16:58:43.645Z","1.0.2":"2020-05-18T03:08:13.032Z","1.0.3":"2020-05-18T07:12:19.205Z","1.0.4":"2020-05-28T08:58:17.044Z","1.0.5":"2020-06-07T12:59:31.111Z","1.0.6":"2020-06-29T06:15:30.599Z","1.0.7":"2020-07-28T10:31:17.806Z","1.0.8":"2020-08-21T01:15:18.670Z","1.0.9":"2020-10-05T02:23:41.077Z","1.0.10":"2020-10-14T06:38:48.408Z","1.0.11":"2020-11-16T04:18:12.726Z","1.1.0":"2020-11-26T08:35:27.571Z","1.1.1":"2020-12-09T21:21:56.020Z","1.2.0":"2020-12-29T10:18:37.494Z","1.3.0":"2021-01-26T02:27:26.610Z","1.4.0":"2021-01-29T04:51:48.789Z","1.4.1":"2021-02-04T07:27:27.383Z","1.5.0-beta.0":"2021-02-05T09:53:55.395Z","1.5.0":"2021-02-25T02:08:01.978Z","2.0.0":"2021-02-26T04:31:11.022Z","2.0.1-beta.0":"2021-02-26T04:34:16.889Z","2.0.1-beta.1":"2021-02-26T08:15:05.391Z","2.0.1-beta.2":"2021-02-27T11:23:22.992Z","2.1.0":"2021-10-15T00:47:49.585Z","1.5.1":"2021-10-17T02:40:53.274Z","2.1.1":"2021-10-19T02:47:22.533Z","2.1.2":"2021-10-22T10:56:12.951Z","2.1.3":"2021-10-23T11:33:43.019Z","2.1.4":"2021-10-26T08:00:31.242Z","2.1.5":"2021-10-28T00:39:51.137Z","2.1.6":"2021-12-10T11:16:43.458Z","2.1.7":"2021-12-17T06:33:00.746Z","2.1.8":"2022-07-25T04:45:11.387Z"},"maintainers":[{"name":"patrixr","email":"patrick.rabier@gmail.com"}],"description":"Cache strapi requests","keywords":["cache","strapi","requests","redis","memcache"],"author":{"name":"Patrick R"},"license":"MIT","readme":"# Strapi LRU Caching middleware - Legacy\n\nA cache middleware for the headless CMS strapi.io\n\n## NO LONGER MAINTAINED\n\nTHIS PROJECT IS DEPRECATED\n\n> Since the release of Strapi v4, this project has been parked in favor of the new [Strapi Plugin Rest Cache](https://github.com/strapi-community/strapi-plugin-rest-cache) which was forked from this repository. Maintainers have now moved there, and we recommend you switch to the new and improved plugin.\n> A big thank you to all those that contributed to this middleware, it has served many.\n\n## TOC\n\n**Strapi V4 users:** https://strapi-community.github.io/strapi-plugin-rest-cache/\n\n![](https://github.com/patrixr/strapi-middleware-cache/workflows/Tests/badge.svg)\n\n- [Strapi LRU Caching middleware - Legacy](#strapi-lru-caching-middleware---legacy)\n  - [NO LONGER MAINTAINED](#no-longer-maintained)\n  - [TOC](#toc)\n  - [How it works](#how-it-works)\n  - [Installing](#installing)\n  - [Version 1 compatibility](#version-1-compatibility)\n  - [Requirements](#requirements)\n  - [Setup](#setup)\n  - [Configure models](#configure-models)\n  - [Configure the storage engine](#configure-the-storage-engine)\n    - [Example](#example)\n      - [With Redis Sentinels](#with-redis-sentinels)\n      - [With Redis Cluster](#with-redis-cluster)\n  - [Per-Model Configuration](#per-model-configuration)\n  - [Single types](#single-types)\n  - [Authentication](#authentication)\n  - [Etag support](#etag-support)\n  - [Clearing related cache](#clearing-related-cache)\n  - [Cache entry point](#cache-entry-point)\n    - [Koa Context](#koa-context)\n    - [Strapi Middleware](#strapi-middleware)\n  - [Cache API](#cache-api)\n  - [Admin panel interactions](#admin-panel-interactions)\n\n## How it works\n\nThis middleware caches incoming `GET` requests on the strapi API, based on query params and model ID.\nThe cache is automatically busted everytime a `PUT`, `PATCH`, `POST`, or `DELETE` request comes in.\n\nSupported storage engines\n\n- Memory _(default)_\n- Redis\n\nImportant: Caching must be explicitely enabled **per model**\n\n## Installing\n\nUsing npm\n\n```bash\nnpm install --save strapi-middleware-cache\n```\n\nUsing yarn\n\n```bash\nyarn add strapi-middleware-cache\n```\n\n## Version 1 compatibility\n\n:warning: Important: The middleware has gone through a full rewrite since version 1, and its configuration may not be fully compatible with the old v1. Make sure to (re)read the documentation below on how to use it 👇\n\n## Requirements\n\nSince `2.0.1`:\n\n- strapi `3.4.0`\n- node `14`\n\n_See `1.5.0` for strapi < `3.4.0`_\n\n## Setup\n\nFor Strapi stable versions, add a `middleware.js` file within your config folder\n\ne.g\n\n```bash\ntouch config/middleware.js\n```\n\nTo use different settings per environment, see the [Strapi docs for environments](https://strapi.io/documentation/v3.x/concepts/configurations.html#environments).\n\nYou can parse environment variables for the config here as well if you wish to, please see the [Strapi docs for environment variables](https://strapi.io/documentation/v3.x/concepts/configurations.html#environment-variables).\n\nEnable the cache middleware by adding the following snippet to an empty middleware file or simply add in the settings from the below example:\n\n```javascript\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n    },\n  },\n});\n```\n\nStarting the CMS should now log the following\n\n```\n$ strapi develop\n[2021-02-26T07:03:18.981Z] info [cache] Mounting LRU cache middleware\n[2021-02-26T07:03:18.982Z] info [cache] Storage engine: mem\n```\n\n## Configure models\n\nThe middleware will only cache models which have been explicitely enabled.\nAdd a list of models to enable to the module's configuration object.\n\ne.g\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      models: ['review'],\n    },\n  },\n});\n```\n\nStarting the CMS should now log the following\n\n```\n$ strapi develop\n[2021-02-26T07:03:18.981Z] info [cache] Mounting LRU cache middleware\n[2021-02-26T07:03:18.982Z] info [cache] Storage engine: mem\n[2021-02-26T07:03:18.985Z] debug [cache] Register review routes middlewares\n[2021-02-26T07:03:18.986Z] debug [cache] POST /reviews purge\n[2021-02-26T07:03:18.987Z] debug [cache] DELETE /reviews/:id purge\n[2021-02-26T07:03:18.987Z] debug [cache] PUT /reviews/:id purge\n[2021-02-26T07:03:18.987Z] debug [cache] GET /reviews recv maxAge=3600000\n[2021-02-26T07:03:18.988Z] debug [cache] GET /reviews/:id recv maxAge=3600000\n[2021-02-26T07:03:18.988Z] debug [cache] GET /reviews/count recv maxAge=3600000\n```\n\n## Configure the storage engine\n\nThe module's configuration object supports the following properties\n\n### Example\n\n#### With Redis Sentinels\n\n```javascript\n// config/middleware.js\n\n/**\n * @typedef {import('strapi-middleware-cache').UserMiddlewareCacheConfig} UserMiddlewareCacheConfig\n */\n\nmodule.exports = ({ env }) => ({\n  settings: {\n    /**\n     * @type {UserMiddlewareCacheConfig}\n     */\n    cache: {\n      enabled: true,\n      type: 'redis',\n      models: ['review'],\n      redisConfig: {\n        sentinels: [\n          { host: '192.168.10.41', port: 26379 },\n          { host: '192.168.10.42', port: 26379 },\n          { host: '192.168.10.43', port: 26379 },\n        ],\n        name: 'redis-primary',\n      },\n    },\n  },\n});\n```\n\n#### With Redis Cluster\n\n```javascript\n// config/middleware.js\n\n/**\n * @typedef {import('strapi-middleware-cache').UserMiddlewareCacheConfig} UserMiddlewareCacheConfig\n */\n\nmodule.exports = ({ env }) => ({\n  settings: {\n    /**\n     * @type {UserMiddlewareCacheConfig}\n     */\n    cache: {\n      enabled: true,\n      type: 'redis',\n      models: ['review'],\n      redisConfig: {\n        cluster: [\n          { host: '192.168.10.41', port: 6379 },\n          { host: '192.168.10.42', port: 6379 },\n          { host: '192.168.10.43', port: 6379 },\n        ],\n      },\n    },\n  },\n});\n```\n\nRunning the CMS will output the following\n\n```\n$ strapi develop\n[2021-02-26T07:03:18.981Z] info [cache] Mounting LRU cache middleware\n[2021-02-26T07:03:18.982Z] info [cache] Storage engine: mem\n[2021-02-26T07:03:18.985Z] debug [cache] Register review routes middlewares\n[2021-02-26T07:03:18.986Z] debug [cache] POST /reviews purge\n[2021-02-26T07:03:18.987Z] debug [cache] DELETE /reviews/:id purge\n[2021-02-26T07:03:18.987Z] debug [cache] PUT /reviews/:id purge\n[2021-02-26T07:03:18.987Z] debug [cache] GET /reviews recv maxAge=3600000\n[2021-02-26T07:03:18.988Z] debug [cache] GET /reviews/:id recv maxAge=3600000\n[2021-02-26T07:03:18.988Z] debug [cache] GET /reviews/count recv maxAge=3600000\n```\n\n## Per-Model Configuration\n\nEach route can hold its own configuration object for more granular control. This can be done simply\nby replacing the model strings in the list by object.\n\nOn which you can set:\n\n- Its own custom `maxAge`\n- Headers to include in the cache-key (e.g the body may differ depending on the language requested)\n\ne.g\n\n```javascript\n// config/middleware.js\n\n/**\n * @typedef {import('strapi-middleware-cache').UserModelCacheConfig} UserModelCacheConfig\n */\n\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      type: 'redis',\n      maxAge: 3600000,\n      models: [\n        /**\n         * @type {UserModelCacheConfig}\n         */\n        {\n          model: 'reviews',\n          headers: ['accept-language']\n          maxAge: 1000000,\n          routes: [\n            '/reviews/:slug',\n            '/reviews/:id/custom-route',\n            { path: '/reviews/:slug', method: 'DELETE' },\n          ]\n        },\n      ]\n    }\n  }\n});\n```\n\nRunning the CMS should now show the following\n\n```\n$ strapi develop\n[2021-02-26T07:03:18.981Z] info [cache] Mounting LRU cache middleware\n[2021-02-26T07:03:18.982Z] info [cache] Storage engine: mem\n[2021-02-26T07:03:18.985Z] debug [cache] Register review routes middlewares\n[2021-02-26T07:03:18.986Z] debug [cache] POST /reviews purge\n[2021-02-26T07:03:18.987Z] debug [cache] DELETE /reviews/:id purge\n[2021-02-26T07:03:18.987Z] debug [cache] PUT /reviews/:id purge\n[2021-02-26T07:03:18.987Z] debug [cache] GET /reviews recv maxAge=1000000 vary=accept-language\n[2021-02-26T07:03:18.988Z] debug [cache] GET /reviews/:id recv maxAge=1000000 vary=accept-language\n[2021-02-26T07:03:18.988Z] debug [cache] GET /reviews/count recv maxAge=1000000 vary=accept-language\n[2021-02-26T07:03:18.990Z] debug [cache] GET /reviews/:slug maxAge=1000000 vary=accept-language\n[2021-02-26T07:03:18.990Z] debug [cache] GET /reviews/:id/custom-route maxAge=1000000 vary=accept-language\n[2021-02-26T07:03:18.990Z] debug [cache] DELETE /reviews/:slug purge\n```\n\n## Single types\n\nBy default, the middleware assumes that the specified models are collections. Meaning that having `'post'` or `'posts'` in your configuration will result in the `/posts/*` being cached. Pluralization is applied in order to match the Strapi generated endpoints.\n\nThat behaviour is however not desired for [single types](https://strapi.io/blog/beta-19-single-types-uid-field) such as `homepage` which should remain singular in the endpoint (`/homepage`)\n\nYou can mark a specific model as being a single type by using the `singleType` boolean field on model configurations\n\ne.g\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      models: [\n        {\n          model: 'footer',\n          singleType: true,\n        },\n      ],\n    },\n  },\n});\n```\n\nRunning the CMS should now show the following\n\n```\n$ strapi develop\n[2021-02-26T07:03:18.981Z] info [cache] Mounting LRU cache middleware\n[2021-02-26T07:03:18.982Z] info [cache] Storage engine: mem\n[2021-02-26T07:03:18.985Z] debug [cache] Register review routes middlewares\n[2021-02-26T07:03:18.986Z] debug [cache] PUT /footer purge\n[2021-02-26T07:03:18.987Z] debug [cache] DELETE /footer purge\n[2021-02-26T07:03:18.987Z] debug [cache] GET /review recv maxAge=3600000\n```\n\n## Authentication\n\nBy default, cache is not looked up if `Authorization` or `Cookie` header are present.\nTo dissable this behaviour add `hitpass: false` to the model cache configuration\n\nYou can customize event further with a function `hitpass: (ctx) => true` where `ctx` is the koa context of the request. Keep in mind that this function is executed before every `recv` requests.\n\ne.g\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      models: [\n        {\n          model: 'footer',\n          hitpass: false,\n          singleType: true,\n        },\n      ],\n    },\n  },\n});\n```\n\n## Etag support\n\nBy setting the `enableEtagSupport` to `true`, the middleware will automatically create an Etag for each payload it caches.\n\nFurther requests sent with the `If-None-Match` header will be returned a `304 Not Modified` status if the content for that url has not changed.\n\n## Clearing related cache\n\nBy setting the `clearRelatedCache` to `true`, the middleware will inspect the Strapi models before a cache clearing operation to locate models that have relations with the queried model so that their cache is also cleared (this clears the whole cache for the related models). The inspection is performed by looking for direct relations between models and also by doing a deep dive in components, looking for relations to the queried model there too.\n\n## Cache entry point\n\n### Koa Context\n\nBy setting the `withKoaContext` configuration to `true`, the middleware will extend the Koa Context with an entry point which can be used to clear the cache from within controllers\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      withKoaContext: true,\n      models: ['post'],\n    },\n  },\n});\n\n// controller\n\nmodule.exports = {\n  async index(ctx) {\n    ctx.middleware.cache; // A direct access to the Cache API\n  },\n};\n```\n\n**IMPORTANT**: We do not recommend using this unless truly necessary. It is disabled by default as it goes against the non-intrusive/transparent nature of this middleware.\n\n### Strapi Middleware\n\nBy setting the `withStrapiMiddleware` configuration to `true`, the middleware will extend the Strapi middleware object with an entry point which can be used to clear the cache from anywhere (e.g., inside a Model's lifecycle hook where `ctx` is not available).\n\n```javascript\n// config/middleware.js\nmodule.exports = ({ env }) => ({\n  settings: {\n    cache: {\n      enabled: true,\n      withStrapiMiddleware: true,\n      models: ['post'],\n    },\n  },\n});\n\n// model\n\nmodule.exports = {\n  lifecycles: {\n    async beforeUpdate(params, data) {\n      strapi.middleware.cache; // A direct access to the Cache API\n    },\n  },\n};\n```\n\n**IMPORTANT**: We do not recommend using this unless truly necessary. It is disabled by default as it goes against the non-intrusive/transparent nature of this middleware.\n\n## Cache API\n\n```javascript\n/**\n * @typedef {import('strapi-middleware-cache').CacheStore} CacheStore\n * @typedef {import('strapi-middleware-cache').MiddlewareCacheConfig} MiddlewareCacheConfig\n * @typedef {import('strapi-middleware-cache').ModelCacheConfig} ModelCacheConfig\n * @typedef {import('strapi-middleware-cache').CustomRoute} CustomRoute\n */\n\nconst cache = {\n  /**\n   * @type {CacheStore}\n   */\n  store,\n\n  /**\n   * @type {MiddlewareCacheConfig}\n   */\n  options,\n\n  /**\n   * Clear cache with uri parameters\n   *\n   * @param {ModelCacheConfig} cacheConf\n   * @param {{ [key: string]: string; }=} params\n   */\n  clearCache,\n\n  /**\n   * Get related ModelCacheConfig\n   *\n   * @param {string} model\n   * @param {string=} plugin\n   * @returns {ModelCacheConfig=}\n   */\n  getCacheConfig,\n\n  /**\n   * Get related ModelCacheConfig with an uid\n   *\n   * uid:\n   * - application::sport.sport\n   * - plugins::users-permissions.user\n   *\n   * @param {string} uid\n   * @returns {ModelCacheConfig=}\n   */\n  getCacheConfigByUid,\n\n  /**\n   * Get models uid that is related to a ModelCacheConfig\n   *\n   * @param {ModelCacheConfig} cacheConf The model used to find related caches to purge\n   * @return {string[]} Array of related models uid\n   */\n  getRelatedModelsUid,\n\n  /**\n   * Get regexs to match all ModelCacheConfig keys with given params\n   *\n   * @param {ModelCacheConfig} cacheConf\n   * @param {{ [key: string]: string; }=} params\n   * @param {boolean=} wildcard\n   * @returns {RegExp[]}\n   */\n  getCacheConfRegExp,\n\n  /**\n   * Get regexs to match CustomRoute keys with given params\n   *\n   * @param {CustomRoute} route\n   * @param {{ [key: string]: string; }=} params\n   * @param {boolean=} wildcard\n   * @returns {RegExp[]}\n   */\n  getRouteRegExp,\n};\n```\n\n## Admin panel interactions\n\nThe strapi admin panel uses a separate rest api to apply changes to records, e.g `/content-manager/explorer/application::post.post` the middleware will also watch for write operations on that endpoint and bust the cache accordingly\n","readmeFilename":"README.md","homepage":"https://github.com/patrixr/strapi-middleware-cache#readme","repository":{"type":"git","url":"git+https://github.com/patrixr/strapi-middleware-cache.git"},"bugs":{"url":"https://github.com/patrixr/strapi-middleware-cache/issues"}}