How do I set caching headers to cache the GET of a url, but not the POST of the url?
How do I set caching headers to cache the GET of a url, but not the POST of the url?
For example, I have the url: /user/register
. Doing a GET on that url returns the registration form. Doing a POST on that url performs the registration. I'd like the开发者_如何学C form to be cached since it doesn't change often.
POSTs don't get cached, as the entire intent of POST is to change something. Set whatever caching you like on the URL, they'll be ignored for the POST side of things.
精彩评论