Skip to content
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

Alias support for extra params #371

Closed
BabyDino opened this issue Dec 31, 2024 · 2 comments
Closed

Alias support for extra params #371

BabyDino opened this issue Dec 31, 2024 · 2 comments
Assignees

Comments

@BabyDino
Copy link

Is your feature request related to a problem? Please describe.
No.

Describe the solution you'd like
Context: we use a load balancer -> NGINX -> WebP server for our CDN.

We would like to remove NGINX because it is another step before reaching the WebP server. NGINX is currently providing 2 things for us:

  1. rewriting the URL's (?w=100 to ?with=100 to be compatible with the WebP server), and
  2. extensive image caching with maximum cache sizes. The latter has been implemented in the WebP server, so there is no need for this anymore.

Since we only use ?w= instead of ?witdh=, our question is if it would be possible to create a configuration option to alias them.

  • height => h
  • width => w
  • max_width => mw
  • max_height =>mh

If we can make these variable, that would be a huge help. Many thanks for your consideration!

Describe alternatives you've considered
Currently an NGINX proxy which rewrites ?w= to ?width=

@n0vad3v
Copy link
Member

n0vad3v commented Dec 31, 2024

Thanks for feedback!

It's a little bit weird for us to add this support, but your request it's very simple to archive, just edit those lines https://github.com/webp-sh/webp_server_go/blob/master/handler/router.go#L48-L51 and re-compile WebP Server Go, this will meet your need.

(If you need any help building your own WebP Server Go, please let us know.

@BabyDino
Copy link
Author

Understandable. Thanks for your consideration!

@BabyDino BabyDino closed this as completed Jan 3, 2025
@BabyDino BabyDino closed this as not planned Won't fix, can't repro, duplicate, stale Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants