Skip to main content
Russ Ortisi
Inspiring
February 13, 2018
Answered

API Manager Cache doesn't seem to be working

  • February 13, 2018
  • 1 reply
  • 339 views

I have an API get request that returns a couple hundred rows with a dozen or so columns of data (one of which contains a paragraph of text). It's not a huge amount of data, but it's not tiny either. This data isn't updated frequently, so I set up caching in the API and set it to 86,400 seconds (1 day).

When I run the API from the RESTClient extension in my Firefox browser the first time it takes about 5 seconds to return back the data set. With caching set, I assumed it would come back much quicker on subsequent tries, but there appears to be no difference. I tried it 6 or 7 times after setting caching and it didn't change.

Then, I set the query to cache every 6 hours to see if that would make a difference. In theory, at least as far as I can tell, it shouldn't, because if the API manager is caching the response it shouldn't be getting back to the query anyhow, but this time it made a huge difference. Now the results come back almost instantaneously.

Given these observations, it seems to me the API Manager's caching isn't actually caching anything. Is there something I am missing?

This topic has been closed for replies.
Correct answer Russ Ortisi

The problem I had was that I set up caching in the caching tab (on the left) but I didn't realize I had to enable it for the specific resource. If you go into "Resources" and expand the resource, you will see a checkbox for caching for that resource. If you enable it there, it will cache the results appropriately.

1 reply

Russ Ortisi
Russ OrtisiAuthorCorrect answer
Inspiring
February 14, 2018

The problem I had was that I set up caching in the caching tab (on the left) but I didn't realize I had to enable it for the specific resource. If you go into "Resources" and expand the resource, you will see a checkbox for caching for that resource. If you enable it there, it will cache the results appropriately.