I have also encountered this problem, because when Glide loads an image, it will cache the image locally. If the URL does not change, it will directly read the cache and not load it over the network. There are two solutions: 1. Clear the cache every time you load. This is a very rubbish solution, which is equivalent to abandoning the very important function of caching. 2. The image address uses this: url+? random number. When the picture is changed, just change the random number in the background, so that you will reload the network picture locally. This is the fundamental solution, and the backend should be designed like this
1. You need to cooperate with the server. When the request is returned, there must be expires in the header to indicate whether the resource has expired. 2. If the resource expires, clear the image cache and reload
I have also encountered this problem, because when Glide loads an image, it will cache the image locally. If the URL does not change, it will directly read the cache and not load it over the network.
There are two solutions:
1. Clear the cache every time you load. This is a very rubbish solution, which is equivalent to abandoning the very important function of caching.
2. The image address uses this: url+? random number. When the picture is changed, just change the random number in the background, so that you will reload the network picture locally. This is the fundamental solution, and the backend should be designed like this
Recommend an open source framework for loading images from the network, Universal Image Loader, which is very convenient to use
1. You need to cooperate with the server. When the request is returned, there must be expires in the header to indicate whether the resource has expired.
2. If the resource expires, clear the image cache and reload