This topic contains 3 replies, has 0 voices, and was last updated by chanarbon 7 years, 8 months ago.

  • Author
    Posts
  • #1203

    JohnCCole

    I’ve been testing the the N/cache module but there seems to be something missing. You can’t really flush the cache. You can remove select keys with-in a cache, but I want to flush all keys within a cache bucket.

    Code:
    var ch = cache.getCache({name:’some_name’,scope:cache.Scope.PUBLIC});
    /// Then I would like to do something like ch.flush() ch.removeAll()
    Is flushing all keys in the cache possible?
    This is a cached copy. Click here to see the original post.

  • #1204

    CREECE

    You can set how long a cache is available. Since they are to be used with server-side scripts, if you set to just use with the life of the script, they will be gone once the script has completed running. What are you seeing that would require the flushing of the cache?

  • #1205

    JohnCCole

    I know I can set the time to live, but there are things I may want to cache that stick around in public scope of my account for longer then the execution of a single script, but if a rare user action invalidates the cache I may want to remove/refresh a single item in a given cache or remove all cached items in a given cache.

    Currently NetSuite supports the removal of a single key at a time from a given cache bucket. I may want to classify my cache into separate buckets, and with-in each bucket I have one to many key value pairs. The key of the cache item could also be dynamically generated by user feedback so the key name might not be known.

    I really don’t have anything I want to do like this as of yet, but in my albeit limited experience with caching libraries like redis it’s possible to have this notion of classifying your cache into separate buckets and being able to empty the bucket without knowing all the key names.

  • #1206

    chanarbon

    Hi John,

    From what I understand from your use case is that you wanted to have cache groups and perform the flushing of KVPs in a cache group basis. Please file a support case and we would have an enhancement filed for this concern.

You must be logged in to reply to this topic.