Reputation:
I'm learning Ruby right now and I got stuck, maybe you guys can help me a bit.
I want to build a small app based on Sinatra that increments a value and prints it on different requests. You go to the root page and you get 1, if you refresh the page you get 2 and so on.
I have no ideea how to get the increment to happen only on refresh
Thanks
Upvotes: 1
Views: 216
Reputation: 836
My approach is to detect a page refresh is:
/increment
)HTTP_CACHE_CONTROL
header for:
max-age=0
(for FF when using F5
or reload
button)no-cache
(for FF and IE when using CTRL-F5
)I hope this helps you to start with your app :)
Upvotes: 1