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: 1. Magento Architecture and Customization Techniques/8. Demonstrate the ability to manage the cache.md
+35-1
Original file line number
Diff line number
Diff line change
@@ -113,11 +113,45 @@ How would you clean the cache? In which case would you refresh cache/flash cache
113
113
114
114
### Describe how to clear the cache programmatically.
115
115
116
-
What mechanisms are available for clearing all or part of the cache?
116
+
To clear the cache programmatically you neeed to call next the methods:
117
+
-[\Magento\Framework\App\CacheInterface::remove($identifier)](https://github.com/magento/magento2/blob/2.2-develop/lib/internal/Magento/Framework/App/CacheInterface.php#L48) - remove cached data by identifier
118
+
-[\Magento\Framework\App\CacheInterface::clean($tags = [])](https://github.com/magento/magento2/blob/2.2-develop/lib/internal/Magento/Framework/App/CacheInterface.php#L56) - clean cached data by specific tag
119
+
120
+
##### What mechanisms are available for clearing all or part of the cache?
121
+
122
+
Dispatch a `clean_cache_by_tags` event with parameter of the object you want to clear from the cache.
-[Magento\PageCache\Observer\FlushCacheByTags](https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/PageCache/Observer/FlushCacheByTags.php#L57) - if Built-In caching is enabled
150
+
-[Magento\CacheInvalidate\Observer\InvalidateVarnishObserver](https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/CacheInvalidate/Observer/InvalidateVarnishObserver.php#L50)- if Varnish caching is enabled
0 commit comments