Bug report #13565

modifying a svg already cached doesn't invalidate the cache, renders as version initially loaded during a session

Added by Mathieu Pellerin - nIRV over 8 years ago. Updated over 6 years ago.

Status:Closed
Priority:Normal
Assignee:Nyall Dawson
Category:Symbology
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:21607

Description

Once a svg file is loaded during a qgis session, its cache stays fixed, even if the svgs are edited / modified. It's a problem when users want to finetune their svg graphics as it forces them to restart the application or create endless new files for edited svgs.

Associated revisions

Revision 0b2de85f
Added by Nyall Dawson over 6 years ago

Check file modified time when retrieving svg images from cache

If file has been modified since the cache, regenerate a new cache
image.

We don't want to check the file modified time too often though,
(e.g., we don't want to check for every point render in a 100k
point file), so use a hardcoded 30 second minimum time between
consecutive file modified checks.

This means that file modifications occuring more often than
every 30 seconds won't be picked up till 30 seconds has elapsed
since the last modification. But at the same time it means that
if the render takes < 30 seconds we'll only check each svg
at most once (and if a render takes > 30 seconds, adding a few
more milliseconds won't hurt!).

Fixes #13565

History

#1 Updated by Paolo Cavallini about 8 years ago

  • Subject changed from modifying a svg already cached doesn't invalidate the csche, renders as version initially loaded during a session to modifying a svg already cached doesn't invalidate the cache, renders as version initially loaded during a session

#2 Updated by Giovanni Manghi almost 7 years ago

  • Easy fix? set to No
  • Regression? set to No

#3 Updated by Håvard Tveite almost 7 years ago

I am developing a Python plugin that is generating SVG symbols for a layer, and since I am reusing file names for the SVGs I am hitting this bug.
Are there any other workarounds than making sure that every SVG file name is unique?

#4 Updated by Jérémy Billant over 6 years ago

Håvard Tveite wrote:

I am developing a Python plugin that is generating SVG symbols for a layer, and since I am reusing file names for the SVGs I am hitting this bug.
Are there any other workarounds than making sure that every SVG file name is unique?

Same problem here. I use timestamp in my SVG file names to make them unique, but I don't really like this solution and so don't release my plugin.
Does any fix is planned? It would be great!

#5 Updated by Nyall Dawson over 6 years ago

  • Assignee set to Nyall Dawson

#6 Updated by Nyall Dawson over 6 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

Also available in: Atom PDF