Allow enabling cache in development mode/disabling cache in production mode #481

Closed
ngocdaothanh opened this Issue Dec 8, 2014 · 0 comments

Projects

None yet

1 participant

@ngocdaothanh
Member

Sometimes the program wants the cache to be enabled in development mode:

  • To test if cache works as expected, before deploying the program to production environment.
  • The program may use cache for its logic (example: save SocialAuth manager in cache), so it wants cache to always be enabled.

Solution: Add cache.enabled to xitrum.conf:

cache {
    # Simple in-memory cache
    "xitrum.local.LruCache" {
      maxElems = 10000
    }

    # - Commented out:   Cache is automatically disabled in development mode,
    #                    and enabled in production mode.
    # - enabled = true:  Force cache to be enabled even in development mode.
    # - enabled = false: Force cache to be disabled even in production mode.
    enabled = true
  }

This is similar to config.action_controller.perform_caching = true of Rails.

@ngocdaothanh ngocdaothanh added the Improve label Dec 8, 2014
@ngocdaothanh ngocdaothanh added this to the Xitrum 3.20 milestone Dec 8, 2014
@ngocdaothanh ngocdaothanh changed the title from Enable object cache in development mode to Allow enabling cache in development mode Dec 9, 2014
@ngocdaothanh ngocdaothanh changed the title from Allow enabling cache in development mode to Allow enabling cache in development mode/disabling cache in production mode Dec 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment