开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜