I worked out what was going on.
Basically, the “request does not repeat” observation is its own caching of Rails in action. Which makes sense, app.get treated like any other request, if caching is enabled, the cache is returned, and if not, it will be repeated (as @henrikhodne claimed). This explains why a puts in the cached controller will not be displayed a second time.
To check, add puts to the 2 controller methods, but just set expires_in to the second. The first will repeat the conclusion, the second will not.
A way to force the request to repeat is to reload the cache by changing the URL, for example. app.get("/") becomes app.get("/?r=123456") just as if you were using HTTP. All this seems obvious in retrospect, basically app.get handled exactly like a client request, and the same rules apply.
source share