Changes between Version 24 and Version 25 of BluePrintRegionsAndIncidents


Ignore:
Timestamp:
04/10/11 16:44:15 (14 years ago)
Author:
Pat Tressel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BluePrintRegionsAndIncidents

    v24 v25  
    100100If the test for whether a location is in a region is expensive (e.g. if it uses polygon overlap), we may want to cache the membership (similar to caching the location's hierarchy path). A location can belong to more than one region, so this would be a list of regions (specified by their region location ids). Would need to record both positive and negative results, i.e. if we test a location against a region and find it's not in that region, we need to record that to avoid redoing the test. The cache would be invalidated if the location's parentage or lon, lat changes.  Invalidating region test results if a region's scope changes (e.g. its border is changed, or a group's membership changes, or if the hierarchy is changed) needs careful consideration to avoid expensive database operations. Fortunately, regions are not expected to be changed frequently.
    101101
    102 We may also want to cache the gis_config currently in effect in the session in any case, not just if it was a region gis_config selected from the menu.  Either way, when a gis_config becomes the current gis_config, any values that now reside in deployment_settings should be copied there, to avoid disrupting existing code.  These are the hierarchy-related values.
     102We may want to record the gis_config currently in effect in the session in any case, not just if it was a region gis_config selected from the menu.  In addition, we can cache the gis_config contents to avoid some db reads.  Since (rumor has it) the session is transmitted to the client on each request (although it appears it is actually saved on the client), and the gis_config is mainly needed on the server, we can just put the id of the selected gis_config in the session, and cache the actual contents in response.  So it will still need to be read on each request, but not repeatedly on each request.
    103103
    104104==== Detail on caching region membership ====