How does this look? Does this go in the right direction?
Changes to be committed:
modified: lib/DDG/Goodie/UltimateAnswer.pm
modified: t/UltimateAnswer.t
If you type in 'answer to' in DDG, the second suggestion is currently 'answer to life the universe and everything'.
And if you type this query into Google, it will output 42 as the answer. So I think it makes sense that the query should also trigger this goodie.
On branch UltimateAnswer
Changes to be committed:
modified: lib/DDG/Goodie/UltimateAnswer.pm
modified: t/UltimateAnswer.t
This explicity sets the caching behavior for all goodies. Goodies which
did not have caching behavior set in their package have had it added.
Similarly for the tests.
This resulted in a number of changes for caching behavior, mostly
moving towards more frequent caching.
I identified three cases where goodies should not be cached. They are when
the result depends upon:
- some random element,
- the time of day or year (as with relative dates), or
- the location of the requesting user
In all other cases, I presumed that the goodies were sufficiently
deterministic in their output to warrant caching.