{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • General /
This question was closed Sep 11, 2015 at 01:41 PM by Michał Nita for the following reason: CacheContext was not properly set.
avatar image
0
Question by Michał Nita · Sep 11, 2015 at 10:11 AM · 519 Views apigeepoliciescachecaching

How do I invalidate cache by InvalidateCache policy?

Hi all, I've reached a problem building my API proxy. For GET method I lookup for data in cache by LookupCache policy (if it's not there i populate it by PopulateCache policy) and for DELETE method I purge it by InvalidateCache policy. Unfortunatelly this cache entry is not cleared at all and GET method sees the old data. Please help. Bellow I attached policies XMLs:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<LookupCache async="false" continueOnError="false" enabled="true" name="Lookup-Cache-For-Messages">
  <DisplayName>Lookup Cache For Messages</DisplayName>
  <Properties/>
  <CacheKey>
  <Prefix/>
  <KeyFragment>os</KeyFragment>
  <KeyFragment ref="verifyapikey.verify-api-key.brand"/>
  <KeyFragment ref="verifyapikey.verify-api-key.locale"/>
  <KeyFragment ref="accesstoken.username"/>
  <KeyFragment>getMessage</KeyFragment>
  </CacheKey>
  <Scope>Exclusive</Scope>
  <CacheResource>OwnerServices</CacheResource>
  <AssignTo>getMessage</AssignTo>
</LookupCache>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<PopulateCache async="false" continueOnError="false" enabled="true" name="Populate-Cache-For-Messages">
  <DisplayName>Populate Cache For Messages</DisplayName>
  <Properties/>
  <CacheKey>
  <Prefix/>
  <KeyFragment>os</KeyFragment>
  <KeyFragment ref="verifyapikey.verify-api-key.brand"/>
  <KeyFragment ref="verifyapikey.verify-api-key.locale"/>
  <KeyFragment ref="accesstoken.username"/>
  <KeyFragment>getMessage</KeyFragment>
  </CacheKey>
  <Scope>Exclusive</Scope>
  <CacheResource>OwnerServices</CacheResource>
  <Source>getMessageResponse.content</Source>
</PopulateCache>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<InvalidateCache async="false" continueOnError="false" enabled="false" name="Invalidate-Cache-For-Messages">
  <DisplayName>Invalidate Cache For Messages</DisplayName>
  <Properties/>
  <CacheKey>
  <Prefix/>
  <KeyFragment>os</KeyFragment>
  <KeyFragment ref="verifyapikey.verify-api-key.brand"/>
  <KeyFragment ref="verifyapikey.verify-api-key.locale"/>
  <KeyFragment ref="accesstoken.username"/>
  <KeyFragment>getMessage</KeyFragment>
  </CacheKey>
  <CacheResource>OwnerServices</CacheResource>
  <Scope>Exclusive</Scope>
  <CacheContext>
  <APIProxyName>Some string</APIProxyName>
  <ProxyName>Some string</ProxyName>
  <TargetName>Some string</TargetName>
  </CacheContext>
  <PurgeChildEntries>false</PurgeChildEntries>
</InvalidateCache>
Comment
Add comment Show 2
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Anil Sagar @ Google ♦♦   · Sep 11, 2015 at 10:19 AM 0
Link

@Michał Nita ,

Welcome to Apigee Community.

Just FYI, You can also use Code Button in rich text editor to prettify your code... I have done that for now :)

code.png (5.4 kB)
avatar image Michał Nita Anil Sagar @ Google ♦♦ · Sep 11, 2015 at 10:41 AM 0
Link

OK, Thank you :)

Close

0 Answers

  • Sort: 

Follow this Question

Answers Answers and Comments

21 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Call dynamic endpoints in cache lookup policy when cached value is not found 1 Answer

Why most of the API calls are hitting the backend, though we have configured responses to be cached ? 1 Answer

In regards to the InvalidateCache policy 1 Answer

Cache update time 2 Answers

Can the object say for example token put in cache by one API be accessed by another API? 1 Answer

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2019 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • Product Announcements
  • General
  • Edge/API Management
  • Developer Portal (Drupal-based)
  • Developer Portal (Integrated)
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Analytics
  • Events
  • Hybrid
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Members
  • Badges