Ways to avoid images and other caches not being refreshed

  Cache this thing, sometimes we need it, sometimes we want to avoid it. And there are many kinds of cache, page cache, database cache, server cache, memory cache and so on.

 

The following is a summary of the methods to avoid page caching. There are two main ways, one is to set, and the other is to add random numbers.

 

① Setting page without cache

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">

 

②Add random numbers:

<img src="<%=basePath%>page/icon/u1001.jpg?<%=Math.random()*100%>" />

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327029159&siteId=291194637