Ajax request 304 problem

 

Ajax enables caching by default, so if the get request has the same path, the cache will be found first, and if the cache exists, the cache will be used.

solution:

1. Modify the url to change dynamically, such as adding a ×tamp=Date.parse(new Date()); after the url

2. Add <META HTTP-EQUIV="pragma" CONTENT="no-cache"> to the specified page to prohibit caching

3. Add cache:false in the ajax request configuration (reference: http://api.jquery.com/jquery.ajax/)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325971588&siteId=291194637