How to check cache page?

In a Ror3 project, how would an elegant way to check if caches_page works as expected in my controllers?

+4
source share
1 answer

If you want to see if the page has been cached, you can check the file in your shared folder. Rails displays a page with the extension .html. If you want to check the subsequent request, then perhaps save the original html response (which was cached) and compare it with the subsequent request. Or maybe use a timestamp in a cached file (although I can see that this is problematic). Are you looking for a specific implementation in rspec, cucumber, etc.?

+1
source

Source: https://habr.com/ru/post/1346391/


All Articles