0
votes

I have a Grails 2.4.4 project configured with the default ':cache:1.1.8' plugin. It also uses the default ":asset-pipeline:1.9.9" plugin.

When running the application, I'm seeing this DEBUG message in the logs:

DEBUG simple.MemoryPageFragmentCachingFilter - No cacheable annotation found for GET:/PROJECTNAME/grails/assets/index.dispatch [controller=assets, action=index]

How do I make this message go away? I don't mean by filtering the log file, I mean by putting a cacheable annotation for the asset pipeline controller, or something like that.

UPDATE: It turns out that I was getting dozens of those DEBUG log messages instead of just one, because of a flaw in sass-asset-pipeline:1.9.0.

I updated to sass-asset-pipeline:1.9.1, because they said they fixed some caching issues in 1.9.1 here: https://github.com/bertramdev/sass-grails-asset-pipeline/issues/11

1

1 Answers

0
votes

You don't want to. Caching responses and method calls should use very different logic from caching static resources.

Typically static resources change rarely and are cached forever, but use a unique name or some other mechanism so if you do change the CSS/JS/etc. file, you can get clients to use the new version.

But caching service method calls and controller responses is typically much more short-lived, since database updates often trigger cache invalidation and flushing to ensure that the correct data is used.

The asset-pipeline plugin and its addon plugins have great support for smart caching and you should manage that there, but not by misusing the cache plugin(s).