Cacheing issues and other improvements in INSIGHT
posted 2018.03.17 by Clark Wilkins, Simplexable

In recent work on the INSIGHT platform, we've been focusing on cacheing. The platform makes extensive use of memcache to store persistent values and avoid database calls to speed up response time. What we do see from time to time though is some cache corruption or failures to re-cache objects that have since updated. Until recently, the best solution we've had was to do a global flush of the cache. It's effective but somewhat dramatic to wipe out every stored object “just to be sure”.

In v16.168, we added a selective clearing system to the utilities menu, and, because the process is not so consequential as a total cache clear, it's now open to all users.

The underlying logic clears only the caches relevant to the target area, so you can clear up a problem in adHoc without redoing all cache information for inventory items. Of course, the complete wipe option is still there at the end of the list, but it's now the last resort rather than the only choice.

Another major cache-architecture change was made in the area of inventory. Prior to v16.169, we cached a 41-element array with all critical info about each inventory item. There are many thousands of these small caches in a typical install before this version, all indexed by the unique company and item ID combined signature. One of the problems with this unique keying was the lack of an effective way to clear 10000 individual caches without resorting to a global flush. What we're now doing is just 41 master caches (one for each parameter), indexed as cache[0-41] with nested arrays that establish the ownership and item ID as internal keys. If we need to clear inventory caches, we just have these 41 to redo — easily accessible by the master level cache[0-41] — rather than 10000s of invididual serial IDs. This made it possible to include clearing item-specific cacheing in the inventory option shown in the picture above.

By request, we deployed “bill-as” capability in v16.170. A new control in customer profiles allows you to give a profile a separate billing name. This is used on customer invoices, credit memos and statements. It's set up in customer account management and then seamlessly replaces the actual account name you use internally. Further discussion of this is in the INSIGHT forums.

Other recent changes include:

  • Invoice search now allows filtering by equipment profile. (16.169.3)
  • Similar item in the mobile client, inventory item view, had a problem displaying other known good items. Now fixed. (16.169.2)
  • Sweeper test 22 was repaired to catch items that are not properly attached to jobs. (16.169.1)
  • The ability to define monitored locations and what inventory is in them (sweeper test 24) was added. (16.167)