开发者

Should Get or should Post be used to get AJAX content that expires often?

开发者 https://www.devze.com 2022-12-20 09:17 出处:网络
I have AJAX calls that get content that开发者_运维技巧 expires often. To get that content is is better practice to use:

I have AJAX calls that get content that开发者_运维技巧 expires often.

To get that content is is better practice to use:

  • Post

or

  • Get and set the Cache Expiration Date as immediate on the server?


You should use GET with this kind of header: "Cache-Control: no-cache, must-revalidate" read when POST should be used.


If you're only retrieving data, then you should use GET and use the appropriate cache-related HTTP headers.

0

精彩评论

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