@@ -115,7 +115,7 @@ Saving Cache Items
115
115
~~~~~~~~~~~~~~~~~~
116
116
117
117
The most common method to save cache items is
118
- ``Psr\\ Cache\ \CacheItemPoolInterface::save ``, which stores the
118
+ ``Psr\Cache\CacheItemPoolInterface::save ``, which stores the
119
119
item in the cache immediately (it returns ``true `` if the item was saved or
120
120
``false `` if some error occurred)::
121
121
@@ -126,9 +126,9 @@ item in the cache immediately (it returns ``true`` if the item was saved or
126
126
127
127
Sometimes you may prefer to not save the objects immediately in order to
128
128
increase the application performance. In those cases, use the
129
- ``Psr\\ Cache\ \CacheItemPoolInterface::saveDeferred `` method to mark cache
129
+ ``Psr\Cache\CacheItemPoolInterface::saveDeferred `` method to mark cache
130
130
items as "ready to be persisted" and then call to
131
- ``Psr\\ Cache\ \CacheItemPoolInterface::commit `` method when you are ready
131
+ ``Psr\Cache\CacheItemPoolInterface::commit `` method when you are ready
132
132
to persist them all::
133
133
134
134
// ...
@@ -149,22 +149,22 @@ Removing Cache Items
149
149
~~~~~~~~~~~~~~~~~~~~
150
150
151
151
Cache Pools include methods to delete a cache item, some of them or all of them.
152
- The most common is ``Psr\\ Cache\ \CacheItemPoolInterface::deleteItem ``,
152
+ The most common is ``Psr\Cache\CacheItemPoolInterface::deleteItem ``,
153
153
which deletes the cache item identified by the given key (it returns ``true ``
154
154
when the item is successfully deleted or doesn't exist and ``false `` otherwise)::
155
155
156
156
// ...
157
157
$isDeleted = $cache->deleteItem('user_'.$userId);
158
158
159
- Use the ``Psr\\ Cache\ \CacheItemPoolInterface::deleteItems `` method to
159
+ Use the ``Psr\Cache\CacheItemPoolInterface::deleteItems `` method to
160
160
delete several cache items simultaneously (it returns ``true `` only if all the
161
161
items have been deleted, even when any or some of them don't exist)::
162
162
163
163
// ...
164
164
$areDeleted = $cache->deleteItems(['category1', 'category2']);
165
165
166
166
Finally, to remove all the cache items stored in the pool, use the
167
- ``Psr\\ Cache\ \CacheItemPoolInterface::clear `` method (which returns ``true ``
167
+ ``Psr\Cache\CacheItemPoolInterface::clear `` method (which returns ``true ``
168
168
when all items are successfully deleted)::
169
169
170
170
// ...
@@ -205,7 +205,7 @@ Pruning Cache Items
205
205
Some cache pools do not include an automated mechanism for pruning expired cache items.
206
206
For example, the :ref: `FilesystemAdapter <component-cache-filesystem-adapter >` cache
207
207
does not remove expired cache items *until an item is explicitly requested and determined to
208
- be expired *, for example, via a call to ``Psr\\ Cache\ \CacheItemPoolInterface::getItem ``.
208
+ be expired *, for example, via a call to ``Psr\Cache\CacheItemPoolInterface::getItem ``.
209
209
Under certain workloads, this can cause stale cache entries to persist well past their
210
210
expiration, resulting in a sizable consumption of wasted disk or memory space from excess,
211
211
expired cache items.
0 commit comments