ThinkGeo.com    |     Documentation    |     Premium Support

How to reset cache at some places and extents?

suppose i just add a new feature to a .shp file.
And that .shp file is cached on both server and client side.
Then how can i force these cache mechanisms to Re-Cache and embrace newly created feature?
besides, client caching would be fail if some one (PERSON_A) add a new feature and some other (PERSON_B) view the result after (PERSON_A) adds the feature. because (PERSON_B) wouldn’t see the newly added feature although he/she can select/search against it, But it is still invisible because it,s not cached.

One way would be to change cache address/path/name etc…
But these ways recreate and cache all features from scratch. and this is time/cpu consuming.
Is there any other solution or workaround?

Can i find and delete corresponding cache image files on “Cache file path” for caching on server?

Hi Reza,

For client side cache, I think you should only make the cache expired, and get it generated again, because the shape had get updated.

For server side cache, I think maybe you have 3 solutions for it:

  1. Use the cache generator to build target extent with the modified data, then replace original data. Or build a totally new group, you can easily replace that by modify the cacheid in code.
  2. Delete old cache tiles, and generate new that when application run
  3. Write custom utility, delete all tiles which contains your new feature, the cache image will be generated when application run.

Regards,

Don

1 Like

Your answer was really helpful but it leads me to some other questions:
1- Then how to find image files in that extent in all available zoom levels?
2- I also tried tileCacheGenerator and it result me in a different zoom levels!!! my zoomlevel folders are like: “147647947.5”,“144447.6442”,etc… BUT generated folders are like: “147647947.5”,“144187.448730469”,etc… As you can see generated folder’s Names are slightly different and because of that i can’t use generated cache images. Why is that? and how can i fix it? (I’d like to note that both generated images are PNG and size of 256*256 in pixles and both MapUnit are GeographyUnit.Meter both have the same projection (BUT DIFFERENT STYLES to recognize newly generated images).
I use mapCurrentExtent for CachingExtent parameter of TileCacheGenerator, I’m wondering to know if it is the extent problem or what?
Thanks

Hi Reza,

  1. It’s not easy, you need write a custom utility, use our tile system to adjust whether some part of the new feature is contained in one tile. And you need loop all the zoom levels.
  2. The folder name is the scale for each zoomlevel, if that’s not the same, that means your zoomlevel is not the same as the generator’s zoomlevel, you can modify that in the code, to implement the custom zoomlevels. That’s not the extent problem, you need check the MapUnit and zoomlevelset.

Regards,

Don