-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better Examples Please #33
Comments
You're looking at the reference documentation, it's not an example. So it will have everything in it. Did you look at the example Caddyfile? https://github.com/caddyserver/cache-handler/blob/master/Caddyfile It's much simpler. |
thank you for the ultra fast response. I did see that page. A bit better. I think the larger problem is that this is really for high end sophisticated caching. I think next I am going to try It is the caddy 1 caching ported to caddy 2. I already am using the caddy 1 caching, it worked great for my needs, and it has all of the same concepts I am used to. I think the Soin caching is just a lot more sophisticated with ore options. When the cdp path fails, I will be back. 9 days to my conference. |
@darkweak tells me that the simplest config is:
soon to be
with a sane default TTL. Hopefully that helps! |
The fastest way to configure the cache-handler is with the ttl directive. The others options are not mandatories. That's specified in the Souin documentation and in the cache-handler too. Feel free to ask more question about the configuration or the behavior under the hood if needed. |
@mholt What do people cache? Well usually it is a slow reverse proxy. In my case a single python process. So next I tried greenmaps.us { This time the error message is Let me add another comment here. There is a huge difference between the needs of large organizations, and small organizations. When Caddy was first released it was perfect for a small organization. Simple to install did automatic certificates, and had simple caching. The big companies, the ones with the money, started using it. They have stronger demands. The simple Caddy 1 got tossed out, and a much more feature rich Caddy 2 came into being. But in so doing it lost the simplicity desired by the small organizations, those with no go developers on staff, nor the money to hire them. Hopefully the simple introductory path to caching can be restored, with the ability to upgrade to the more sophisticated options when it eventually becomes needed. Thank you for being so helpful. |
|
That makes sense. `{ greenmaps.us { And the errror message was: caddy responded with error: HTTP 400: { But in fact the module is listed.
|
The cache directive should be enabled in the global options too I think.
|
The fast responses are wonderful. ` greenmaps.us { ` and ` greenmaps.us { Give me the same error messages. I also tried lots of other things. And just to make sure I am not being stupid, that module does exist. `
The good news, is that once I get this simple example working, we will have a simple example, for those who follow in my footsteps. |
Make sure you are running the same Caddy binary that has the module plugged in. |
That Worked. your-domain.com { ` The last comment really helped.
On freebsd the command: pkg install caddy Does not just copy in the file, it creates a service. So once I upgraded /usr/local/etc/caddy, I could not just do caddy reload I had to do service caddy stop service caddy onestart My bad. Live and learn. Your support has been fantastic. I will also say that your whole concept of automatic https is brilliant. If you take a look at the nginx configuration files generated by the Let's Encrypt certbot, there is a ton of repetitive junk in there, repeated for each domain I configure. The top part of my configuration file is quite useful.
` `
anaged by Certbot } server { So it would be good to add something like this to your marketing materials, where you compare caddy to NGINX. I fear that my users will want to use nginx. I would like a page to post them to. Maybe I will write it myself. Thanks for all of the help. Of course I will probably still have some troubles. But getting much much closer. |
Using Souin, you can now use only the
|
I was in a similar boat as PythonLinks, without this threadf I would have given up. Please put a simple complete example in the README. And please put some comments into it, e.g. the Caddyfile in this repo has exactly zero comments, so one is left to guess what each section is intended to demonstrate. |
You will find it much easier to configure cdp-cache. From my cdp-cache pull request. This is a http cache plugin for caddy 2. The difference between this and cache-handler https://github.com/caddyserver/cache-handler is that this one is much easier to understand and configure. But it does not support a distributed ache, and it needs to be compiled with golang 1.17 and caddy version v2.4.6 |
Link? Edit: I assume you mean https://github.com/sillygod/cdp-cache |
Here is my cdp-cache pull request. I am running it on caddy on Bastille containers on FreeBSD. If you choose to go down that route, I would be happy to advise. I found messing with go installations was trivial within Bastille. Every time I did it wrong I just blew away the container and repeated. |
Please check the README in the Souin repository. The cache-handler will be updated tomorrow to add the new features and be able to set the following directive in the caddyfile
I never got an issue while trying to store more than 1MB but if you need more examples I can just say to wait 1 day until I write some others. |
Which new features? |
I followed these instructions on a fresh Debian 12 box, seemingly successfully. But `systemctl reload caddy` would reject my Caddyfile that tried to use those custom modules, logging "unknown module" errors, even though `caddy list-modules` reported that they were installed. After reading [a comment on `caddyserver/cache-handler`][c], I tried running `systemctl restart caddy`, which immediately fixed the issue. In retrospect, it makes sense that since `apt install caddy` starts the systemd service, replacing the binary on the filesystem does nothing to change the running server. But the instructions didn't suggest this, and I'm used to only `reload`ing Caddy, so I didn't think of it myself. [c]: caddyserver/cache-handler#33 (comment) wchargin-branch: custom-build-systemctl-restart wchargin-source: 91f0cc15ae1eb8143fccc271e7aa2ecae5bc3da8
I followed these instructions on a fresh Debian 12 box, seemingly successfully. But `systemctl reload caddy` would reject my Caddyfile that tried to use those custom modules, logging "unknown module" errors, even though `caddy list-modules` reported that they were installed. After reading [a comment on `caddyserver/cache-handler`][c], I tried running `systemctl restart caddy`, which immediately fixed the issue. In retrospect, it makes sense that since `apt install caddy` starts the systemd service, replacing the binary on the filesystem does nothing to change the running server. But the instructions didn't suggest this, and I'm used to only `reload`ing Caddy, so I didn't think of it myself. [c]: caddyserver/cache-handler#33 (comment) wchargin-branch: custom-build-systemctl-restart wchargin-source: 91f0cc15ae1eb8143fccc271e7aa2ecae5bc3da8
I am a beginner at configuring Caddy. Never tried Soin.
You have one example which tosses everything in. Way too complex for the beginner to figure out. I feel like giving up.
It would be great to have a simple proxy cache server example.
Then a more complex one caching based on path, or cookies.
Then a few other simple examples.
I could read each example by itself, and soon I would understand what is going on. Right now there are just to many new things to learn to figure it out quickly.
The text was updated successfully, but these errors were encountered: