This message was deleted.
# community-support
s
This message was deleted.
v
Why should you enable caching for a task that simply writes a properties file. Making it cacheable would make the build slower, not faster.
j
Ah, I saw it was taking 10 seconds (and the other two related tasks other 5 seconds) and I thought it would be faster. Thank you for the clarification 👍
v
Maybe use the
gradle-profiler
to find out what is taking long. But the actual task action should usually be blazingly fast. And making it cacheable would mean that instead of writing a simple text file, you have to download an archive, store it to the local cache, unpack the archive to retrieve the output file. And when not restoring cached version the text file needs to be put to archive, put to local cache and potentially put to remote cache. Usually this should be too much overhead for a task that writes a simple text file.
But it should also not need 5 or 10 seconds to write a simple text file. If it is the input fingerprinting that needs significant time or similar, that wouldn't change with caching as you still need those for the cache key calculation
If you really want to have the task cached, iirc you need
cacheIf { true }
or something like that.
👍 1
j
I will check it with the profiler. Maybe it was a simple run and it is not happening as default in all runs
👌 1