You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+60-60Lines changed: 60 additions & 60 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,15 +27,15 @@ One Class uses for All Cache. You don't need to rewrite your code many times aga
27
27
\* Driver descriptions available in DOCS/DRIVERS.md
28
28
29
29
### Symfony developers are not forgotten !
30
-
Starting of the v5, phpFastCache comes with a [Symfony Bundle](https://github.com/PHPSocialNetwork/phpfastcache-bundle).
31
-
He's fresh, so feel free to report any bug or contribute to the code using pull requests.
30
+
Starting with v5, phpFastCache comes with a [Symfony Bundle](https://github.com/PHPSocialNetwork/phpfastcache-bundle).
31
+
It's fresh, so feel free to report any bug or contribute to the project using pull requests.
32
32
33
33
---------------------------
34
34
Not a "Traditional" Caching
35
35
---------------------------
36
-
phpFastCache is not a traditional caching method which keep read and write to files, sqlite or mass connections to memcache, redis, mongodb... Also, when you use Memcache / Memcached, your miss hits will be reduce.
37
-
Different with normal caching methods which shared everywhere on internet, phpFastCache Lib reduce the high I/O load, and faster than traditional caching method at least x7 ~+ times.
38
-
However, some time you still want to use traditional caching, we support them too.
36
+
phpFastCache is not like the traditional caching methods which keep reading and writing to files, sqlite or keeping open massive amounts of connections to memcache, redis, mongodb... Also, when you use Memcache / Memcached, your miss hits will be reduced.
37
+
Different from the usual caching methods you'll find everywhere on the internet, the phpFastCache library reduces high I/O load, and is faster than the traditional caching methods by at least ~7 times.
38
+
However, when you still want to use traditional caching methods, we support them too.
39
39
40
40
```php
41
41
use phpFastCache\CacheManager;
@@ -50,8 +50,8 @@ CacheManager::Files($config);
50
50
Reduce Database Calls
51
51
---------------------------
52
52
53
-
Your website have 10,000 visitors who are online, and your dynamic page have to send 10,000 same queries to database on every page load.
54
-
With phpFastCache, your page only send 1 query to DB, and use the cache to serve 9,999 other visitors.
53
+
Your website has 10,000 visitors who are online, and your dynamic page has to send 10,000 times the same queries to database on every page load.
54
+
With phpFastCache, your page only sends 1 query to your DB, and uses the cache to serve the 9,999 other visitors.
55
55
56
56
---------------------------
57
57
Rich Development API
@@ -60,68 +60,68 @@ Rich Development API
60
60
phpFastCache offers you a lot of useful APIs:
61
61
62
62
### Item API
63
-
- getKey() // Return the item identifier (key)
64
-
- get() // The getter, obviously, return your cache object
65
-
- set($value) // The setter, for those who missed it, put 0 meant cache it forever
66
-
- expiresAfter($ttl) // Allow you to extends the lifetime of an entry without altering the value (formerly known as touch())
63
+
- getKey() // Returns the item identifier (key)
64
+
- get() // The getter, obviously, returns your cache object
65
+
- set($value) // The setter, for those who missed it, putting 0 means cache it forever
66
+
- expiresAfter($ttl) // Allows you to extends the lifetime of an entry without altering its value (formerly known as touch())
67
67
- expiresAt($expiration) // Sets the expiration time for this cache item (as a DateTimeInterface object)
68
-
- increment($step = 1) // For integer that we can count on
68
+
- increment($step = 1) // To allow us to count on an integer item
69
69
- decrement($step = 1) // Redundant joke...
70
-
- append($data) // Append data to a string or an array (push)
71
-
- prepend($data) // Prepend data to a string or an array (unshift)
72
-
- isHit() // Check if your cache entry exists and is still valid, it is the equivalent of isset()
73
-
- isExpired() // Check if your cache entry is expired
74
-
- getTtl() // Get the remaining Time To Live as an integer
75
-
- getExpirationDate() // Get the expiration date as a Datetime object
76
-
- addTag($tagName) // Add a tag
77
-
- addTags(array $tagNames) // Add many tags
78
-
- setTags(array $tags) // Set some tags
79
-
- getTags() // Get the tags
80
-
- getTagsAsString($separator = ', ') // Get the data a string separated by $separator
81
-
- removeTag($tagName) // Remove a tag
82
-
- removeTags(array $tagNames) // Remove some tags
70
+
- append($data) // Appends data to a string or an array (push)
71
+
- prepend($data) // Prepends data to a string or an array (unshift)
72
+
- isHit() // Checks if your cache entry exists and is still valid, it's the equivalent of isset()
73
+
- isExpired() // Checks if your cache entry is expired
74
+
- getTtl() // Gets the remaining Time To Live as an integer
75
+
- getExpirationDate() // Gets the expiration date as a Datetime object
76
+
- addTag($tagName) // Adds a tag
77
+
- addTags(array $tagNames) // Adds multiple tags
78
+
- setTags(array $tags) // Sets multiple tags
79
+
- getTags() // Gets the tags
80
+
- getTagsAsString($separator = ', ') // Gets the data as a string separated by $separator
More informations about the implementation and the events on the [Wiki](https://github.com/PHPSocialNetwork/phpfastcache/wiki/%5BV6%5D-Introducing-to-events)
165
+
More information about the implementation and the events available on the [Wiki](https://github.com/PHPSocialNetwork/phpfastcache/wiki/%5BV6%5D-Introducing-to-events)
166
166
167
167
---------------------------
168
168
As Fast To Implement As Opening a Beer
@@ -176,7 +176,7 @@ As Fast To Implement As Opening a Beer
176
176
composer require phpFastCache/phpFastCache
177
177
```
178
178
179
-
#### :construction: Step 2: Setup your website code to implements phpFastCache bits (With Composer)
179
+
#### :construction: Step 2: Setup your website code to implement the phpFastCache calls (with Composer)
180
180
```php
181
181
use phpFastCache\CacheManager;
182
182
@@ -215,7 +215,7 @@ if (is_null($CachedString->get())) {
215
215
}
216
216
217
217
/**
218
-
* use your products here or return it;
218
+
* use your products here or return them;
219
219
*/
220
220
echo implode('<br />', $CachedString->get());// Will echo your product list
221
221
@@ -224,8 +224,8 @@ echo implode('<br />', $CachedString->get());// Will echo your product list
0 commit comments