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

Add a function to zlib data compression #12868

Open
razonyang opened this issue Sep 20, 2024 · 4 comments
Open

Add a function to zlib data compression #12868

razonyang opened this issue Sep 20, 2024 · 4 comments
Labels

Comments

@razonyang
Copy link
Contributor

One use case is to generate Kroki.io diagrams without requesting APIs, and reduce build time and avoid network issues.

@bep
Copy link
Member

bep commented Sep 20, 2024

You can POST diagrams to Kroki, see https://docs.kroki.io/kroki/setup/usage/#post-request -- I'm not sure your other arguments are very convincing. Build time should be the same. What network issues?

@razonyang
Copy link
Contributor Author

You can POST diagrams to Kroki

Yes, I can, I'm implementing it via GetRemote.

Build time should be the same

APIs should take more time than local compression. With this feature, there won't be HTTP requests during the build stage.

What network issues?

One example is that the API may crash sometime, which could cause the build to fail.

@bep bep removed the NeedsTriage label Sep 20, 2024
@jmooring
Copy link
Member

It seems to me that calling the Kroki API once with a POST request (and caching the returned image) makes more sense that to have every client call the Kroki API with a GET request.

I would rather know about a Kroki API crash during a build than have clients see broken images.

@bep
Copy link
Member

bep commented Sep 23, 2024

APIs should take more time than local compression. With this feature, there won't be HTTP requests during the build stage.

OK, then I misunderstood. I will keep this proposal open. The proposed use case isn't convincing enough alone for this to be added to Hugo.

If someone asked me how to Integrate Kroki with Hugo, I would agree with @jmooring and say that the best/recommended way would be to do POST request during builds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants