{ 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
0
Question by Chawki MATTA · Feb 23 at 03:10 PM · 45 Views cachepopulate cachelookupcache

Cache transaction details instead of the application session

Hello,
is it possible to store temporarily the user session details instead of the application session

In other words: having millions of users asking for eligibility in request 1 then subscribing in request 2

=> request 1 will return a token valid for 5 min, the latter can be used to subscribe in a service.

I am avoiding the check eligibility a second time when subscribing within 5 minutes (OTP lifetime)...

can a cache be used for this purpose as well?

Comment
Add comment
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

Close

3 Answers

  • Sort: 
avatar image
2

Answer by Dino-at-Google   · Feb 23 at 10:15 PM

Sure you can use PopulateCache and LookupCache for caching arbitrary data using various keys.

But, you will need a way to distinguish one user from another. Some unique identifier. A Token does that, but if you are caching something BEFORE you grant a token, then you don't have the unique identifier.

Solving your problem the way you've described it may be a bit of a challenge.

One way to do it is to use the "messageid". This is a unique identifier for every message. You could use that a the cachekey in the first request, and then send it back in the response. The require the caller to re-transmit the original messageid in the subsequent request-for-token message. This would allow you to lookup an item in the cache based on the original messageid.

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
1

Answer by Priyadarshi Ajitav Jena · Feb 23 at 10:36 PM

We have worked recently on this type of scenario. In our case the request for a particular user creates a session at backend side. In response header the session id and cookies comes back to the client app and the same is used for the subsequent calls to maintain the session.

Another scenario is there we have used for one of the mobile users. We create a new access token and refresh token with password grant type for the first call. Then for the next calls of that session it uses token generation with refresh token grant type. That ensures the entire process is a session.

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 Chawki MATTA · Feb 24 at 08:12 AM

Thank you @Dino-at-Google and @Priyadarshi for your reply,

It's good to know that this method can be used to achieve the requirements and even to be the best practice to do that on APIGEE.

Actually, we went over the documentation but it did not answer our technical concerns

Knowing that Cached data is stored in machine memory, so the cache can store data "up to the memory capacity of the virtual machine", which means it's not precisely specified here.

If we have millions of users requesting this API would there be an impact on the environment?

in the documentation, we see that we can have 2.5 million items in each cache:
(Q) When creating a cache in the UI we have a field to set the Expiry date, is it for all the KeyFragments that will be created later on? or it will be considered as the default time for a "keyFragment" if the <ExpirySettings> param is not set?

Thank you,


cache-time-setup.png (13.8 kB)
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

Follow this Question

Answers Answers and Comments

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

Related Questions

Deprecated [TimeoutInSec] in expiry settings in Populate Cache policy 1 Answer

QUERIES about cache 1 Answer

How are concurrent writes managed using populate cache policy 1 Answer

Store the data into cache and retrive data from cache 3 Answers

Apigee can not retreive data from Cache 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
© 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