-
Notifications
You must be signed in to change notification settings - Fork 9
Offloading your api: a discussion about caching
Your mission is to maximize the caching of your API. If you choose to accept this mission you will be celebrated by your customers, industry application performance watchdogs (e.g. Gomez, Keynote) and praised by your Site / API Operations Manager.
- Avoid generating the object that compose your API responses repeatedly
- Allow these to age as long as possible
- Distribute objects to areas they are requested
- Enforce event driven object invalidation
Meet users expectation of a snappy response
- User perception of performance is typically positive if the response below 250 ms
- Conduct user sentiment analysis for keywords such as speed, slowest, frustrated, slow, etc
Conserve resources for important tasks
- Mission critical resources e.g. checkout, likes, follows or any other expensive transaction
- Heavily repeated transaction conducive to caching is to be maximized.
Enable consistent performance across http clients
- Consider caching impacts on various http clients and proxies that can cache responses or objects.
- Maximize caching on any level of your stack that supports. Carefully consider all opportunities from the browser to systems of record.
Eliminate loss opportunities due to poor response times
- Frustrated users typically equal dissatisfied API consumers.
- Understand and measure performance impacts against conversion goals. Communicate this to business partners.
For example:
- 0s - 1s response predicts a +%2 increase in conversion from average.
- 4s - 6s response indicates %1 drop in conversion from average.
- Greater than 6s response indicate a 3% drop in conversion from average.
Sentiment Analysis is key.
- Put your ears to groundswell and highlight user feedback on regarding performance.
- Use sentiment analysis to mine API consumer comments, forums and reviews.
Some Example Comments
Customer Emails - "You definitely need to speed your mobile site up. It take forever to see my friends updates and review my timeline."
API Program Forums - "I think you may have the slowest API I've ever used. I seem to get a more timeout using your service compared to similar APIs."
Customer Service Reps - "Customer reports that our site was painfully slow, forcing them use our competitors site."
Site Reviews / Surveys - "25% users report that performance is tolerable. 10% report frustration, 3% report dissatisfaction"
- Identify maximum offload during peak traffic
- Identify minimum offload during off-peak traffic
- Set a year-round average cache hit offload goal
- Identify most popular resource traffic pathways
- Maximize caching for those resources
- Enable instant response on reverse paths (i.e. return to menu, back button, etc)
- Adjust Time to Live to maximize offload
- Set different TTLs for each fragment of the response
- Determine TTL offload ratio e.g. 4h TTL = 70% offload
- Determine offload for most popular or mission critical resources
- Increase TTLs incrementally and observe and measure increase in offloaded traffic.
- Ensure scheduled content is up to date
- Enable pre-determined future effective and expiration dates for relevant response fragments
to be continued….