Add file-backed UUID cache #149


  • Enhancment
  • Accepted
Open
Assigned to _ForgeUser1494830
  • _ForgeUser1494830 created this issue Jun 24, 2014
    Owner

    zPermissions' internal UUID cache, by default, expires entries after 5 minutes. Though this is tweakable (with uuid-cache-ttl), when using expirations greater than a day, the benefits gradually decline due to the cache being in-memory only.

    Should look into using a file-backed cache for UUID caching.

    Note that Mojang NMS code has a cache already. This is what maintains usercache.json in the server root directory. However, this cache does not appear to be thread safe and besides, it is NMS code. Bukkit does not expose access to this code other than through getOfflinePlayer(). In addition to using the possibly non-thread safe NMS code, getOfflinePlayer() never returns null for non-existent players making it unusable for my UUID resolver.

  • _ForgeUser1494830 added the tags Accepted Enhancment Jun 24, 2014
  • _ForgeUser1494830 posted a comment Jul 16, 2014

    Also need a command or two to flush the cache. Either the entire cache or just a certain player (identified by UUID or name).

  • _ForgeUser1494830 posted a comment Jul 16, 2014

    The cache could potentially be shared, so making it file-backed probably isn't the best solution (when using database storage).

    So when using database storage, it probably makes more sense to store the cache in the database.

    Can either overload the current display_name column in both entities and memberships (but will need to add some sort of expiration column).

    Or just use a completely separate table with: name, uuid, expiration.

    Separate table sounds better.

    For flat file, can use a separate map/dict within the same file.


To post a comment, please login or register a new account.