You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of plugin version 4.0.0, controller caching is no longer supported. However, if the @Cacheable annotation is added to a controller method, the expected behavior should be that the annotation is ignored and the controller action is executed every time. Currently, this does not happen. Instead, the method is executed only the first time as if it were being cached, causing serious problems. If the controller action receives parameters, it always shows the same result, regardless of the parameters passed in subsequent calls.
class ProductsController {
@Cacheable('show')
def show (Long id) {
println "I'm in ${id}"
}
}
Specific Problem:
First Execution: On the first execution, if the method is called with id = 1, it will print "I'm in 1".
Subsequent Executions: If the method is called again with id = 2, the action is not executed because the method is already cached, causing an inconsistency in the response. The output will still be "I'm in 1".
The text was updated successfully, but these errors were encountered:
jsolas
changed the title
@cacheables in controller actions
@cacheable in controller actions shouldn't do anything
Jan 18, 2023
As of plugin version 4.0.0, controller caching is no longer supported. However, if the
@Cacheable
annotation is added to a controller method, the expected behavior should be that the annotation is ignored and the controller action is executed every time. Currently, this does not happen. Instead, the method is executed only the first time as if it were being cached, causing serious problems. If the controller action receives parameters, it always shows the same result, regardless of the parameters passed in subsequent calls.Specific Problem:
id = 1
, it will print"I'm in 1"
.id = 2
, the action is not executed because the method is already cached, causing an inconsistency in the response. The output will still be"I'm in 1"
.The text was updated successfully, but these errors were encountered: