Code Monkey home page Code Monkey logo

vsm-dictionary-cacher's People

Watchers

 avatar  avatar

vsm-dictionary-cacher's Issues

Add more cache types

  • Maintain a cache for getRefTerms() too.

    • Load all at first call for anything, then just look up any filter.str-requests in there.
    • And catch and resolve concurrent calls.
    • -> Then cacheEmpty-hits should work instantaneously in vsm-autocomplete.

  • Maintain cache a for getDictInfos() too.

    • Piggy-back calls if an identical request is already running.
    • Look if all elems of the given array are already in the cache.
      • If so, build a result with them and async-return it.
      • If not (if even only 1 of them isn't there yet), simply query them all.
      • Cache timeout/size management: only clear this when the master timeout fires.
    • -> Then cache-hits should work instantaneously in autocomplete.

  • Enhance the cache management for loadFixedTerms() too.

      • Note: this function (of the VsmDictionary parent class) queries
        the VsmDictionary subclass's getEntries(), and puts the processed
        results in its own simple cache (in the VsmDictionary parent class).
      • But if a webpage contains multiple vsm-autocomplete components,
        then each of them will call the (shared) VsmDictionary's loadFixedTerms()
        and launch a query. So this queries and adds results to the VsmDictionary's
        fixedTermsCache, no matter whether these results were in there already.
    • If a call with the same arguments has ever been made before,
      (?:) or if the requested idts are all already in the cache,
      then just async-return OK immediately.
    • If a call with same arguments is still ongoing, then don't send a parallel
      same request, but wait until that one finishes, and then call the
      queued one's callback using the same results.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.