roadrunner-server / roadrunner-plugins

📦 Home for the roadrunner plugins
MIT License
25 stars 9 forks source link

feat(http): http cache, level 1 #186

Closed rustatian closed 2 years ago

rustatian commented 2 years ago

Reason for This PR

ref: #66 , level 1 closes: #187 closes: #185

Description of Changes

A possible configuration for the cache middleware:

http:
# .....
    middleware: ["cache"]
    cache:
        driver: memory
        cache_methods: ["GET", "HEAD", "POST"] # only GET by default
        config: {}

Supported headers:

License Acceptance

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

PR Checklist

[Author TODO: Meet these criteria.] [Reviewer TODO: Verify that these criteria are met. Request changes if not]

codecov[bot] commented 2 years ago

Codecov Report

Merging #186 (f2b5b3b) into master (7c27f9f) will increase coverage by 0.70%. The diff coverage is 77.21%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #186      +/-   ##
==========================================
+ Coverage   67.65%   68.36%   +0.70%     
==========================================
  Files         133      141       +8     
  Lines       10414    10756     +342     
==========================================
+ Hits         7046     7353     +307     
- Misses       2632     2633       +1     
- Partials      736      770      +34     
Impacted Files Coverage Δ
amqp/amqpjobs/consumer.go 69.33% <ø> (ø)
amqp/amqpjobs/item.go 73.28% <ø> (ø)
amqp/amqpjobs/redial.go 66.66% <ø> (ø)
beanstalk/beanstalkjobs/consumer.go 72.54% <ø> (ø)
beanstalk/beanstalkjobs/item.go 73.97% <ø> (-5.48%) :arrow_down:
boltdb/boltjobs/consumer.go 66.53% <ø> (ø)
boltdb/boltjobs/item.go 45.32% <ø> (ø)
boltdb/boltkv/driver.go 51.69% <ø> (ø)
broadcast/rpc.go 69.81% <ø> (ø)
http/handler/request.go 79.76% <ø> (ø)
... and 81 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7c27f9f...f2b5b3b. Read the comment docs.

lgtm-com[bot] commented 2 years ago

This pull request introduces 5 alerts when merging 0797b85953eda5a811efedb79d7de898d4ae0269 into 7c27f9f6904cbe89ba35903fed4a0a4faa86bfa3 - view on LGTM.com

new alerts:

lgtm-com[bot] commented 2 years ago

This pull request introduces 5 alerts when merging 2cb3ba1950061cf1703a044f2ac07492c65e868c into 7c27f9f6904cbe89ba35903fed4a0a4faa86bfa3 - view on LGTM.com

new alerts:

lgtm-com[bot] commented 2 years ago

This pull request introduces 5 alerts when merging bc20261da63f2c134888f08d5adc4764125fd358 into 7c27f9f6904cbe89ba35903fed4a0a4faa86bfa3 - view on LGTM.com

new alerts:

lgtm-com[bot] commented 2 years ago

This pull request introduces 5 alerts when merging b69872596bffed274aa9fd13b89c70430b7f7ec3 into 7c27f9f6904cbe89ba35903fed4a0a4faa86bfa3 - view on LGTM.com

new alerts:

lgtm-com[bot] commented 2 years ago

This pull request introduces 5 alerts when merging bb8599ca6570cef2ed8fbd1b47dfe663040a5ab1 into 7c27f9f6904cbe89ba35903fed4a0a4faa86bfa3 - view on LGTM.com

new alerts:

lgtm-com[bot] commented 2 years ago

This pull request introduces 5 alerts when merging 606b8fdd40a6d165207e48926efeae1700fd128f into 7c27f9f6904cbe89ba35903fed4a0a4faa86bfa3 - view on LGTM.com

new alerts:

lgtm-com[bot] commented 2 years ago

This pull request introduces 5 alerts when merging 9a1ed6ce90853ba8f7ef78d6e9b8fc4b6f577f08 into 7c27f9f6904cbe89ba35903fed4a0a4faa86bfa3 - view on LGTM.com

new alerts:

lgtm-com[bot] commented 2 years ago

This pull request introduces 5 alerts when merging e2047878e45e87930a6fc2c4d9493f03cfe22911 into 7c27f9f6904cbe89ba35903fed4a0a4faa86bfa3 - view on LGTM.com

new alerts:

lgtm-com[bot] commented 2 years ago

This pull request introduces 5 alerts when merging b22aa2bf4c0ede7f0ac937e7d23766b89f6e311a into 7c27f9f6904cbe89ba35903fed4a0a4faa86bfa3 - view on LGTM.com

new alerts:

lgtm-com[bot] commented 2 years ago

This pull request introduces 5 alerts when merging f2b5b3b1a36fee52517618ef078aa4194175a774 into 7c27f9f6904cbe89ba35903fed4a0a4faa86bfa3 - view on LGTM.com

new alerts: