DEV Community

Discussion on: Please ELI5 about POST / PUT / PATCH best practices

Collapse
 
matthewbdaly profile image
Matthew Daly

Why can't we use POST for everything?

Because going with the grain of HTTP means things like HTTP caching are more likely to work as expected. If your site is behind a caching proxy like Varnish, then using the correct HTTP methods means it's more likely to "just work" as expected because Varnish knows what each one does and can act accordingly. You can work around this by writing your own rules, but why do that if you don't have to?

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt
Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt

I should try varnish-cache.org/ someday, especially if I use AWS or DigitalOcean.

Collapse
 
matthewbdaly profile image
Matthew Daly

You should also bear in mind that some users may be behind a proxy you don't control, such as if their employer uses a web proxy like Squid to reduce the bandwidth used.