Changes between Version 1 and Version 2 of SharedTileCache
- Timestamp:
- 2014-03-23T18:50:52+01:00 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
SharedTileCache
v1 v2 82 82 == Cache discovery == #CacheDiscovery 83 83 84 When initializing cache management, applications should list all available caches inside the shared tile cache, and parse their respective cacheproperties.84 When initializing cache management, applications willing to use the shared tile cache should list all available caches inside the shared tile cache, and parse their respective properties files. 85 85 86 Applications '''must not''' depend ingon the ID (given by the directory name), but should instead locate the cache by ''matching'' on "url", "type" and possibly "extension". If a suitable match is found, the ''existing'' ID/directory should be used for further access.86 Applications '''must not''' depend on the ID (given by the directory name), but should instead locate the cache by ''matching'' on "url", "type" and possibly "extension". If a suitable match is found, the ''existing'' ID/directory should be used for further access. 87 87 88 88 If no suitable directory can be found, a ''new'' directory can be safely created inside the shared root. The application is free to choose any valid directory name, but ''should'' use a short, explicative name. … … 92 92 Assuming an empty tile cache, the application is free to create any file by downloading it from the provider and using the appropriate "/zoom/x/y.extension" pattern, creating missing directories. 93 93 94 Additional data can be stored for each tile, using the file named "/zoom/x/y.extension.ini". This file follows the same convention as the [#CacheProperties] file, and is a simple UTF-8 encoded "key=value" file containing arbitrary keys which are application-defined. Again, applications '''must'' ignore unknown keys, ''can'' add new keys, but '''must'' also preserve any existing one when updating the content. Applications are free to create/update the metadata file at any time. 94 Additional data can be stored for each tile, using the file named "/zoom/x/y.extension.ini". This file follows the same convention as the [#CacheProperties] file, and is a simple UTF-8 encoded "key=value" file containing arbitrary keys which are application-defined. Again, applications '''must''' ignore unknown keys, ''can'' add new keys, but '''must''' also preserve any existing one when updating the content. Applications are free to create/update the metadata file at any time. 95 95 96 96 When probing the cache for an existing tile, the application '''must''' check for the presence of the tile image "/zoom/x/y.extension" and check it's modification time. If the tile has been created ''or'' modified less than the specified cache age, the application '''must''' use the existing tile. … … 110 110 * After deciding to create or update a tile, the image file ("/zoom/x/y.extension") '''must''' be moved ''atomically'' into the directory tree (and not created in-place), ''replacing'' any existing file (if any). At attempt can then be made to read the associated "ini" file. The "ini" file '''must be ignored''' if it's create/modification time is earlier than the image file and '''must''' then be deleted if not replaced. 111 111 112 * When deleting an existing tile, an attempt to remove "ini" file must be made first, followed by the image file.112 * When deleting an existing tile, the image file must be removed first, followed by an attempt to remove the "ini" file, and the x/zoom directories in turn. 113 113 114 114 * Applications '''must not''' expect written tiles (or their metadata) to exist on disk or be the same as previously written.
