honojs / website

Repository for hono.dev
https://hono.dev
68 stars 208 forks source link

fix typo in cache.md #387

Closed ykyki closed 2 weeks ago

ykyki commented 3 weeks ago

This PR fixes minor typos in cache.md. https://hono.dev/middleware/builtin/cache

yusukebe commented 2 weeks ago

Hi @ykyki

This is not a typo. It works well with app.get().

ykyki commented 2 weeks ago

Thanks @yusukebe .

After a quick check, I found that app.get() worked well.

However, app.use() also seems to work correctly. I was under the impression that app.use() was more suitable for middlewares.

Is there any criterion for determining which approach is more appropriate?

yusukebe commented 2 weeks ago

Hi @ykyki

I intended to apply cache middleware only for GET requests in this document, which is useful for real-world examples.

ykyki commented 2 weeks ago

@yusukebe

I understood your intention. In light of that, app.get() is indeed more appropriate than app.use() for this case.

I intend to withdraw this PR. Thank you for your guidance.