Skip to content

Commit aa8bc5d

Browse files
committed
add cache suhggestions
1 parent 07fec6e commit aa8bc5d

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<p class='cache-component__cache-key'><%= view_cache_dependencies %></p>
2-
<p class='cache-component__cache-message'><%= "#{foo} #{bar}" %></p>
2+
<p class='cache-component__cache-message' data-time=data-time="<%= Time.zone.now %>"><%= "#{foo} #{bar}" %></p>

test/sandbox/app/controllers/integration_examples_controller.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ def controller_inline
1111
render(ControllerInlineComponent.new(message: "bar"))
1212
end
1313

14+
def controller_inline_cached
15+
foo = params[:foo] || "foo"
16+
bar = params[:bar] || "bar"
17+
render(CacheComponent.new(foo:, bar:))
18+
end
19+
1420
def controller_inline_with_block
1521
render(ControllerInlineWithBlockComponent.new(message: "bar").tap do |c|
1622
c.with_slot(name: "baz")

test/sandbox/config/routes.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
get :inline_products, to: "integration_examples#inline_products"
1212
get :cached, to: "integration_examples#cached"
1313
get :render_check, to: "integration_examples#render_check"
14+
get :controller_inline_cached, to: "integration_examples#controller_inline_cached"
1415
get :controller_inline, to: "integration_examples#controller_inline"
1516
get :controller_inline_with_block, to: "integration_examples#controller_inline_with_block"
1617
get :controller_inline_baseline, to: "integration_examples#controller_inline_baseline"

0 commit comments

Comments
 (0)