I configured a cache in swagger for my a127 project and deployed it to the Apigee cloud. I made sure that the Apigee cloud had a cache configured with the same name as in my swagger file ('catalog-cache').
After I deployed the project to the apigee cloud, it appeared the the caching was working. Also, when I manually cleared the cache inside the apigee edge portal it also seemed made the call longer on the first hit so it really appears as through the cache is working.
The problem is that when I go to the Apigee Edge portal Cache Perfomance page, it says that there is 'No Data to Show'.
I would have expected this page to show my hits on the cache.
I'm wondering if there is something else I need to do to get this working.
Thanks,
...Ed
P.S. below is the configuration for the cache inside my swagger file:
x-a127-services: cache: provider: *cacheProvider options: name: catalog-cache ttl: 60000 uri: *apigeeProxyUri key: *apigeeProxyKey fallback: name: catalog-cache-memory provider: volos-cache-memory options: ttl: 60000 maxEntries: 10000
Solved! Go to Solution.
Hi Ed,
I believe you need to add and configure an analytics policy to your a127 configuration. Check out this blog topic (just posted today) for details. And also see this "quick start" doc topic.
Will
Hi Ed,
I believe you need to add and configure an analytics policy to your a127 configuration. Check out this blog topic (just posted today) for details. And also see this "quick start" doc topic.
Will
Perfect! Thanks Will ... I'll read through that and I'm sure that will help.
Hi Will,
I did try setting things up using the blog post you reference but still have some problems. I posted more details below so I wouldn't hit the character limit.
...Ed
Hi Will,
I read the blog post you reference and set up analytics in my a127 swagger file and I am still can't seem to get any analytics on caching.
I do see data for all of the other analytic pages just not for the cache page. It sure appears that the cache is working because I do clear the cache inside Apigee portal and that does affect the results.
One thing that I noticed that I was not doing right originally is that I was hitting the test environment and I only set up the cache for the prod environment. So I fixed that and I am still not seeing data in the Cache Performance page.
Is the CachePerformance analytics availble for a127 apps? I also noticed that when I create a custom report that includes cache dimensions, none of the cache dimensions have any data while other included dimensions do.
Below are some snippets from my swagger file in case it gives a clue as to something that I am doing wrong:
x-a127-services: cache: provider: *cacheProvider options: name: catalog-cache ttl: 60000 uri: *apigeeProxyUri key: *apigeeProxyKey fallback: name: catalog-cache-memory provider: volos-cache-memory options: ttl: 60000 maxEntries: 10000 analytics: provider: *analyticsProvider options: key: *apigeeProxyKey uri: *apigeeProxyUri proxy: API_Procurement bufferSize: 100 flushInterval: 10 batchSize: 10 ... /catalog: x-swagger-router-controller: catalog x-a127-apply: cache: key: helper: cacheHelpers function: getCatalogKey analytics: {} get: description: Retrieves a list of catalog items operationId: getCatalog parameters: - $ref: "#/parameters/vendorParameter" - $ref: "#/parameters/catalogTypeParameter" - $ref: "#/parameters/itemTypeParameter" - $ref: "#/parameters/sortParameter" - $ref: "#/parameters/offsetParameter" - $ref: "#/parameters/limitParameter" - $ref: "#/parameters/compatibleWithParameter" responses: "200": $ref: "#/responses/CatalogResponse" default: $ref: "#/responses/ErrorResponse"
Thanks for all your help,
...Ed
Hi Ed,
Nothing jumps out at me -- it's good you're getting feedback on the other dashboards, though.
Does the API_Procurement proxy name show up at all as a dimension in the Cache Dashboard?
I assume you're selecting "Hour" for the time (otherwise data can take longer to show up).
Someone with more knowledge about this may need to help out. In the meantime, I'll set up a test api to try it myself.
Will
Hi Will,
API_Procurement does not show up as a dimension in the Cache Dashboard (although it does show up on the Proxy Performance dashboard). In fact, on the Cache Performance dashboard, the dimansion: proxy says (empty).
Thanks so much for looking into this.
...Ed
Hi Will, any luck tracking this down. So far I in a127 I setup a cache using the volos-cache-memory provider and then deployed. It seemed to be caching in memory as far as I could tell because my response time went from a little over a second to about 200ms.
Then I switched the provider to the volos-cache-apigee and deployed it. It seems like it might be caching because I am going from 1500ms down to 850ms and every so often I get 20ms or 200ms.
Were you able to try this out? Is the cache performance analytics supported by a127? or is there something else I need to do to get this to work?
Hi Ed,
Sorry for the delayed response .. I did try to track this down, and it looks like when you deploy to Edge, a127 cache hits are not recorded in the analytics system. So, currently, Edge AX doesn't know if a response was served from the cache when it comes from an a127 backend. Your cache is working, but just not showing up in the AX dashboard. Issue #64 is somewhat related, but I'll open another issue specifically about cache.
Will