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

Idea: cache POST request with specific header #15

Open
kallehauge opened this issue Feb 1, 2019 · 2 comments
Open

Idea: cache POST request with specific header #15

kallehauge opened this issue Feb 1, 2019 · 2 comments

Comments

@kallehauge
Copy link

It would be awesome to be able to cache some POST requests (ex: product filters etc) and I get why they are bypassed by default. But would you be open to the idea of adding a header that would allow caching of POST?

Best regards

@esolitos
Copy link
Contributor

esolitos commented Aug 7, 2019

Just my 2 cents: I think that the use cases for caching POST requests are so few and so specific that would not make to much sense to implement in a generic container like wodby/varnish

@kallehauge
Copy link
Author

kallehauge commented Aug 13, 2019

@esolitos both servers and clients have a max size of GET request lengths. The server size could simple be adjusted but we cannot control the allowed size of the client (I think the safest size is still 2KB; even though it has been a few years since I last researched it). Because of this alone, sometimes, what could have been GET requests, is being executed as POST requests instead to make sure. And in my mind, if you have requests that are bigger than 2KB, then they must be pretty heavy as well, so these could be pretty awesome to be able to cache.

There are very few ecommerce solutions today that do not offer products filters, to mention a specific example.
The case also becomes extra obvious in the WordPress would where a lot of times the values passed around are slugs/machine-names instead of simple ids, so the size of a GET request can quickly build up. product-type=231,5,23,543 => product-type=plane-tshirts,winter-jackets,womens-skirts,miscellaneous-sunglasses.

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