Python: empty cache before rendering? We have an animation where particles are emitted from a plane, using a PNG image texture as a density influence.

When rendering through the Blender GUI, if the PNG texture is changed and the animation replayed, the new texture is used as a density influence and the simulation renders correctly.

However, when rendering a single frame from the command line and using a Python script to change the PNG logo, the density influence does not get updated. As a consequence, the new PNG image will display, but the particles will emit as if the old PNG texture was still in place.

Looks as if we need to explicitly tell Blender to empty its cache(s) - from Python. Does anyone know how to do that?

Thanks!
Found a solution, which has nothing to do with caching:

The animation displays a PNG image (texture) which will be replaced by particles that then disappear. The image seems to be dissolving.

To change the image dynamically, a Python script assigns a new PNG to the texture, with bpy.data.textures['Logo'].image = IMAGE.

What was missing was to also update the texture for the particle emitter. This can be done as follows in Python: bpy.data.particles['ParticleSettings'].active_texture.image = IMAGE

Without updating the particle emitter, the visible image would change, but the particles would still emit from where the old image was.