{ 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
    • Adapter for Envoy
    • 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 /
  • Edge/API Management /
avatar image
2
Question by akshay_anand · May 06, 2015 at 03:54 PM · 1.3k Views cacheelapsed time

Populate Cache Expiry Time is not getting set correctly

I am trying to populate some entries in cache , I have used ref variable for setting the <Timeout in Sec> tag.

Please see my policy details below:

<PopulateCache name="PopulateCacheForXYZ"> 
  <DisplayName>PopulateCacheForUSSA</DisplayName> 
  <FaultRules/> 
  <Properties/> 
  <CacheKey> 
    <Prefix/> 
    <KeyFragment ref="XYZcode"/> 
  </CacheKey> 
  <CacheResource>test-cache</CacheResource> 
  <Scope>Global</Scope> 
  <ExpirySettings> 
    <TimeoutInSec ref="expirytime_for_cache">7200</TimeoutInSec> 
  </ExpirySettings> 
  <Source>access_token</Source> 
</PopulateCache>

So I am fetching "expirytime_for_cache" from KVM , The KVM value is being retrieved correctly , but the Cache Population never exceeding 2 Hours.

Can you please help with the issue?

Comment
Add comment Show 3
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 akshay_anand · May 06, 2015 at 05:23 PM 0
Link

@Maruti Chand Please find the response of the management API call:

{
  "compression": {
    "minimumSizeInKB": 2048
  },
  "description": "",
  "diskSizeInMB": 0,
  "distributed": true,
  "expirySettings": {
    "timeoutInSec": {
      "value": "36000"
    },
    "valuesNull": false
  },
  "inMemorySizeInKB": 2048,
  "maxElementsInMemory": 1000,
  "maxElementsOnDisk": 1000,
  "name": "test-cache",
  "overflowToDisk": true,
  "persistent": false,
  "skipCacheIfElementSizeInKBExceeds": 1024
}

avatar image Dino ♦♦   · Sep 10, 2015 at 12:56 AM 0
Link

What you have done here works for me. I suggest that you double check that you have the context variable set properly. You can use the Trace window to do so.

avatar image akshay_anand Dino ♦♦ · Sep 10, 2015 at 05:19 AM 0
Link

The issue was resolved , the fix was simple if I am specifying the value in TimeoutInSec along with ref value

<TimeOutInSec ref= "timeout">7200</TimeOutInSec>

It always picks the value and doesn't consider ref value , even if ref value is coming , so I just removed the value 7200 and it started working.

Close

2 Answers

  • Sort: 
avatar image
0

Answer by ozanseymen   · May 11, 2015 at 10:13 PM

Ref attribute in TimeoutInSec works - I don't think this is your problem if you are setting the variable value correctly.

In your cache properties, I am seeing "inMemorySizeInKB": 2048. Is it possible that you are hitting this upper bound when you are caching new data in? Apigee cache works in LRU eviction algorithm.

You are also setting compression minimumSizeInKB to 2048 (same value as inMemorySizeInKB) - are you sure this is correct?

It might make sense to create a new cache resource leaving default values in for those parameters and retrying with lower TTL values.

Comment
Add comment · Link
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
0

Answer by Kurt Googler Kanaskie · Jan 13, 2018 at 08:49 PM

Old post, but I was having same issue if I use both the ref and the value, only the value is used.

This behaves differently than the Interval on Quota which treats the literal as a default.

Comment
Add comment Show 5 · Link
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 Anup Rai · Oct 30, 2019 at 12:34 PM 0
Link

Is this issue resolved? Even form me ref value is not used when I specify some value in TimeoutInSec.

avatar image Dino-at-Google ♦♦ Anup Rai   · Oct 30, 2019 at 04:35 PM 2
Link

I don't believe it's resolved, in fact I don't know of a bug in the backlog covering this behavior. For now you'll have to workaround the problem.

I've just created a bug for this behavior. b/143612992

It's in the backlog.

avatar image Alexander Micchelli Dino-at-Google ♦♦ · Oct 27, 2020 at 05:33 PM 0
Link

Hello all - We are seeing the same issue on our instance of Apigee. I was curious if this bug was already resolved or if this fix is in progress?

Show more comments
avatar image Venkata Sattar Dino-at-Google ♦♦ · Jan 11 at 09:41 AM 0
Link

I'm facing this issue now. Just curious to know if it is resolved.

Follow this Question

Answers Answers and Comments

23 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 avatar image avatar image

Related Questions

Is there a name for the 'default' or 'shared' cache? 5 Answers

How can I fetch expired cache if my API fails from apigee edge 1 Answer

if there is a way to skip caching in L2 1 Answer

Clear multiple cache entries using a single invalidate cache policy flow 0 Answers

Can't I store an object in the Cache? 2 Answers

  • 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
© 2021 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
  • Adapter for Envoy
  • 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
  • Badges