Purging by UID #48
              
                
                  
                  
                    Answered
                  
                  by
                    stafyniaksacha
                  
              
          
                  
                    
                      jakubmirejovsky
                    
                  
                
                  asked this question in
                Q&A
              
            -
| Hi, what is the best approach to purge the cache by uid of the cached entity? This is what we are using now, but I feel it's not the right way: How to purge all related cache entries to an entity represented by its uid (eg. 'api::item-log.item-log')? Any help would be appriciated. I tried clearByUid() but with no luck. | 
Beta Was this translation helpful? Give feedback.
      
      
          Answered by
          
            stafyniaksacha
          
      
      
        Mar 22, 2023 
      
    
    Replies: 1 comment
-
| Hello! You can use  | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
      Answer selected by
        jakubmirejovsky
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Hello!
You can use
cacheStore.clearByUidmethodhttps://github.com/strapi-community/strapi-plugin-rest-cache/blob/0f47f3b9edb934907f12ae9f7e11f7829b986ec0/packages/strapi-plugin-rest-cache/server/services/cacheStore.js#L203