We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a34995c + de88140 commit 6eddc53Copy full SHA for 6eddc53
lib/cortex/snippets/client.rb
@@ -15,7 +15,13 @@ def cortex_client
15
end
16
17
def current_webpage(request)
18
- cortex_client.webpages.get_feed(request_url(request)).contents
+ if defined?(Rails)
19
+ Rails.cache.fetch("webpages/#{request_url(request)}", expires_in: 30.minutes) do
20
+ cortex_client.webpages.get_feed(request_url(request)).contents
21
+ end
22
+ else
23
+ raise 'Your Web framework is not supported. Supported frameworks: Rails'
24
25
26
27
private
lib/cortex/snippets/version.rb
@@ -1,5 +1,5 @@
1
module Cortex
2
module Snippets
3
- VERSION = '0.3.2'
+ VERSION = '0.4.0'
4
5
0 commit comments