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
+3-4Lines changed: 3 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -95,17 +95,16 @@ CriticalPathCss.generate_all # Generates critical CSS for all routes i
95
95
CriticalPathCss.clear route # Removes the CSS for the given route from the cache
96
96
97
97
CriticalPathCss.clear_matched routes # Removes the CSS for the matched routes from the cache
98
-
99
-
CriticalPathCss.clear_all # Clears all CSS from the cache
100
98
```
101
99
100
+
NOTE: The `clear_matched` method will not work with Memcached due to the latter's incompatibility with Rails' `delete_matched` method. We recommend using an alternative cache such as [Redis](https://github.com/redis-store/redis-rails).
101
+
102
102
In addition to the `critical_path_css:generate` rake task described above, you also have access to task which clears the CSS cache:
103
103
104
104
```
105
105
rake critical_path_css:clear_all
106
106
```
107
-
108
-
NOTE: The `clear_all` and `clear_matched` methods will not work with Memcached due to the latter's incompatibility with Rails' `delete_matched` method. We recommend using an alternative cache such as [Redis](https://github.com/redis-store/redis-rails).
107
+
NOTE: The `critical_path_css:clear_all` rake task may need to be customized to suit your particular cache implementation.
109
108
110
109
Careful use of these methods allows the developer to generate critical path CSS dynamically within the app. The user should strongly consider using a [background job](http://edgeguides.rubyonrails.org/active_job_basics.html) when generating CSS in order to avoid tying up a rails thread. The `generate` method will send a GET request to your server which could cause infinite recursion if the developer is not careful.
0 commit comments