Opened 4 years ago
Last modified 4 years ago
#19549 new enhancement
[RFC Patch] Don't store cached file information in preferences
Reported by: | taylor.smock | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core | Version: | |
Keywords: | Cc: |
Description (last modified by )
Since, as far as I know, JOSM Preferences never clears out old entries, it would be nice to avoid adding unnecessary entries.
The attached patch does the following:
- Uses file metadata to get the age of the file
- Adds an option to have files deleted on graceful exit (does not delete files if the exit is forced).
This is an RFC since (AFAIK) there are not commonly used file systems which do not store the modification time.
Attachments (2)
Change History (8)
by , 4 years ago
Attachment: | 19549.patch added |
---|
comment:1 by , 4 years ago
Description: | modified (diff) |
---|
comment:3 by , 4 years ago
Ah, probably entries like this:
<list key='mirror.C:\Users\Gerd\AppData\Local\JOSM\cache\images.https://raw.githubusercontent.com/OpenNauticalChart/josm/master/icons/svg/Q/Q126/CEVNI/berthing_lateral_limit.svg'> <entry value='1548567266688'/> <entry value='C:\Users\Gerd\AppData\Local\JOSM\cache\images\mirror_https___raw.githubusercontent.com_OpenNauticalChart_josm_master_icons_svg_Q_Q126_CEVNI_berthing_lateral_limit.svg'/> </list>
comment:4 by , 4 years ago
I originally copied the CachedFile source into the OpenQA plugin (since I usd it to get data from various QA APIs -- I didn't want to accidentally overload someone's server). I made some modifications there so that I wouldn't make JOSM Preferences explode in size.
But yes, that would probably be another entry that would be unnecessary.
follow-up: 6 comment:5 by , 4 years ago
Hmm, I'm not enthusiastic about the proposal. Why not simply add a cleanup function in Prefs loader which clean unnecessary stuff from time to time (i.e. with version upgrades)?
by , 4 years ago
Attachment: | 19549.preferences_cleanup.patch added |
---|
Add a cleanup function to preferences
comment:6 by , 4 years ago
Replying to stoecker:
Hmm, I'm not enthusiastic about the proposal. Why not simply add a cleanup function in Prefs loader which clean unnecessary stuff from time to time (i.e. with version upgrades)?
I've added a cleanup function (it isn't perfect, and it definitely needs more work, but I think it is the direction you were talking about).
Initial RFC patch