Skip to content

Commit 4aa16e3

Browse files
committed
Merge pull request #16 from cortex-cms/revert-11-etag-modifications
Revert "Etag modifications"
2 parents e6977a5 + 19fcb71 commit 4aa16e3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/cortex/snippets/client.rb

+7-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ def cortex_client
1515
end
1616

1717
def current_webpage(request)
18-
cortex_client.webpages.get_feed(request_url(request)).contents
18+
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+
end
1925
end
2026

2127
private

0 commit comments

Comments
 (0)