diff --git a/source/index.txt b/source/index.txt index e6e6b65..413c91d 100644 --- a/source/index.txt +++ b/source/index.txt @@ -1,9 +1,9 @@ .. _mongoid-odm-landing: .. _mongoid-odm: -================================ +==================================== {+odm+}: The ODM for MongoDB in Ruby -================================ +==================================== .. toctree:: :titlesonly: diff --git a/source/whats-new.txt b/source/whats-new.txt index 8753c6e..c98494f 100644 --- a/source/whats-new.txt +++ b/source/whats-new.txt @@ -30,6 +30,26 @@ fixes: as raw hashes. To learn more, see the :ref:`mongoid-raw-results` section of the Modify Query Results guide. +- Improves caching functionality by modifying the behavior of + ``cache_key`` to *not* embed a timestamp when ``cache_version`` + returns a non-nil value. Instead, the timestamp is used as the version + for the entry to reduce key churn. + + This change also adds the ``cache_version`` method to the + ``Mongoid::Document`` module. If the cache key format introduced in + this version poses an issue in your application, you can revert to + the original format by defining the ``cache_version`` method as + ``nil``: + + .. code-block:: ruby + :emphasize-lines: 3 + + module Mongoid + module Document + def cache_version = nil + end + end + .. _mongoid-version-9.0: What's New in 9.0