Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
PHP Microservices

You're reading from   PHP Microservices Transit from monolithic architectures to highly available, scalable, and fault-tolerant microservices

Arrow left icon
Product type Paperback
Published in Mar 2017
Publisher Packt
ISBN-13 9781787125377
Length 392 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Carlos Pérez Sánchez Carlos Pérez Sánchez
Author Profile Icon Carlos Pérez Sánchez
Carlos Pérez Sánchez
Pablo Solar Vilariño Pablo Solar Vilariño
Author Profile Icon Pablo Solar Vilariño
Pablo Solar Vilariño
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. What are Microservices? FREE CHAPTER 2. Development Environment 3. Application Design 4. Testing and Quality Control 5. Microservices Development 6. Monitoring 7. Security 8. Deployment 9. From Monolithic to Microservices 10. Strategies for Scalability 11. Best Practices and Conventions 12. Cloud and DevOps

Caching


Many times consumers request the same things, and the application returns the same information. In this scenario, caching is the solution to avoid constantly processing the same request and returning the required data faster.

Caching is used for data that does not change frequently in order to have a precalculated response without processing the request. The workflow is as follows:

  1. The first time that the consumer requests some information, the application processes the request and gets the required data.

  2. It saves the required data for that request in the cache with an expiration time that we define.

  3. It returns the data to the consumer.

Next time that a consumer requests something you need to do the following:

  1. Check whether the request is in the application cache and it has not expired.

  2. Return the data located in the cache.

So, in our example, we will use caching in the location microservice in order to avoid requesting the closest secrets multiple times.

The first thing that we need to use...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image