caddyserver / cache-handler

Distributed HTTP caching module for Caddy
Apache License 2.0
274 stars 23 forks source link

how to configure redis with caddy? #40

Closed vncloudsco closed 1 year ago

vncloudsco commented 2 years ago

hello team I have read the configuration but still don't understand how to configure because the documentation is not clear when configuring caddy with redis, i have configured redis on Caddyfile as below but found that they don't work with cache, so how can i configure it properly? Can someone give me a sample Caddyfile configuration file?

{
        order coraza_waf first
        order cache before rewrite
}
caddy.manhtuong.net {
        coraza_waf {
                include /etc/caddy/waf/config.conf
                include /etc/caddy/waf/whitelist.conf
                include /etc/caddy/waf/coreruleset/crs-setup.conf.example
                include /etc/caddy/waf/coreruleset/rules/*.conf
        }
        cache {
                redis {
                        url 127.0.0.1:6789
                }
        }
        route / {
                rate_limit {body.id} 200r/m
        }
        file_server {
            hide .git
        }
        reverse_proxy x.x.x.x:9000
        log {
                output file /home/caddy/caddy.manhtuong.net.log
        }
}
PythonLinks commented 2 years ago

I will chime in here. I also have problems with configuration, so I am now unhappily using nginx. You recently released a new version, with a very simple configuration example, but more work on the docs, and more simple examples are most needed.

Someday you will get it right, and then I will be able to ditch NGINX and certbot and all of that complexity.

darkweak commented 2 years ago

more work on the docs

@PythonLinks You can submit a PR for that if you think that the configuration is not clear. Ask for specific configurations examples with the cases you want to know how to configure. 🙂

darkweak commented 2 years ago

@vncloudsco there was a wrong condition in the redis provider integration. Resolved here https://github.com/darkweak/souin/issues/270#issuecomment-1293873241 but not yet available in the cache-handler (I plan to create the release on monday 🤞).

vncloudsco commented 2 years ago

@darkweak this is good news thank you! I will wait for information from you!

darkweak commented 1 year ago

@vncloudsco sorry for the delay, I prepared the PR to bump the Souin dependency and I had to check if everything works well using the latest release. I will merge and tag the new version tomorrow.

darkweak commented 1 year ago

@vncloudsco v0.4.0 has been released! Feel free to reopen if needed.