ccocchi / rabl-rails

Rails 4.2+ templating system with JSON, XML and Plist support.
MIT License
209 stars 51 forks source link

reset_source_cache #17

Closed lloydmeta closed 11 years ago

lloydmeta commented 11 years ago

Hi,

Firstly, thanks for creating this great gem :) I'm hoping to get more performance out of my Rails app with this gem.

In Rabl, there is a Rabl.reset_source_cache! method to reset source caches when cache_sources is set to true.

Is there something similar for RablRails?

lloydmeta commented 11 years ago

To answer my own question;

Under lib/rabl-rails/library.rb

    def initialize
      @cached_templates = {}
    end

In other words, the templates are actually just cached until the next time a server restarts since it uses a variable on a singleton to do the caching as opposed to sending this to memcached or some external cache.

ccocchi commented 11 years ago

Yes, that's how it works. But if needed we can add a RablRails.reset_source_cache method (even thought I never had the use for it)