A simple php method that uses redis for caching. php uses redis for caching. A simple php method that uses redis for caching. php uses redis for caching. the cache method described here is relatively simple. The following is a general idea: Example: A list cache example, because of a simple php method that uses redis for caching, php uses redis for caching.
The cache method described here is relatively simple. The following is a rough idea:
Example:
A list cache example can be cached for 1 minute because the real-time requirement of list data is not high.
General Idea:
Determine based on the request url:
1. if there is a record in redis after the request url is hashed, the data in redis is directly returned.
2. if no record is found in redis after the request url is hashed, the database (mysql) is queried, saved to redis, and returned.
Url format: Module, controller, action, page
Redis Cache data format:
There are two types:
One is html tags, that is, html pages rendered by the framework.
The other is josn data, which is the data required by ajax requests.
@ Note
I have been using php for five months. This idea was developed by my colleagues (leaders). record it.
20150809
The caching method described here is relatively simple. The following is a general idea: Example: A list cache example, because...