<commit_before>require 'set'

module ActionController #:nodoc:
  module Caching
    # Action caching is similar to page caching by the fact that the entire
    # output of the response is cached, but unlike page caching, every
    # request still goes through Action Pack. The key benefit of this is
    # that filters run before the cache is served, which allows for
    # authentication and other restrictions on whether someone is allowed
    # to execute such action. Example:
    #
    #   class ListsController < ApplicationController
    #     before_filter :authenticate, :except => :public
    #
    #     caches_page   :public
    #     caches_action :index, :show
    #   end
    #
    # In this example, the +public+ action doesn't require authentication
    # so it's possible to use the faster page caching. On the other hand
    # +index+ and +show+ require authentication. They can still be cached,
    # but we need action caching for them.
    #
    # Action caching uses fragment caching internally and an around
    # filter to do the job. The fragment cache is named according to
    # the host and path of the request. A page that is accessed at
    # <tt>http://david.example.com/lists/show/1</tt> will result in a fragment named
    # <tt>david.example.com/lists/show/1</tt>. This allows the cacher to
    # differentiate between <tt>david.example.com/lists/</tt> and
    # <tt>jamis.example.com/lists/</tt> -- which is a helpful way of assisting
    # the subdomain-as-account-key pattern.
    #
    # Different representations of the same resource, e.g.
    # <tt>http://david.example.com/lists</tt> and
    # <tt>http://david.example.com/lists.xml</tt>
    # are treated like separate requests and so are cached separately.
    # Keep in mind when expiring an action cache that
    # <tt>:action => 'lists'</tt> is not the same as
    # <tt>:action => 'list', :format => :xml</tt>.
    #
    # You can set modify the default action cache path by passing a
    # <tt>:cache_path</tt> option. This will be passed directly to
    # <tt>ActionCachePath.path_for</tt>. This is handy for actions with
    # multiple possible routes that should be cached differently. If a
    # block is given, it is called with the current controller instance.
    #
    # And you can also use <tt>:if</tt> (or <tt>:unless</tt>) to pass a
    # proc that specifies when the action should be cached.
    #
    # Finally, if you are using memcached, you can also pass <tt>:expires_in</tt>.
    #
    # The following example depicts some of the points made above:
    #
    #   class ListsController < ApplicationController
    #     before_filter :authenticate, :except => :public
    #
    #     caches_page :public
    #
    #     caches_action :index, :if => proc do<commit_msg>Typo fix<commit_after>require 'set'

module ActionController #:nodoc:
  module Caching
    # Action caching is similar to page caching by the fact that the entire
    # output of the response is cached, but unlike page caching, every
    # request still goes through Action Pack. The key benefit of this is
    # that filters run before the cache is served, which allows for
    # authentication and other restrictions on whether someone is allowed
    # to execute such action. Example:
    #
    #   class ListsController < ApplicationController
    #     before_filter :authenticate, :except => :public
    #
    #     caches_page   :public
    #     caches_action :index, :show
    #   end
    #
    # In this example, the +public+ action doesn't require authentication
    # so it's possible to use the faster page caching. On the other hand
    # +index+ and +show+ require authentication. They can still be cached,
    # but we need action caching for them.
    #
    # Action caching uses fragment caching internally and an around
    # filter to do the job. The fragment cache is named according to
    # the host and path of the request. A page that is accessed at
    # <tt>http://david.example.com/lists/show/1</tt> will result in a fragment named
    # <tt>david.example.com/lists/show/1</tt>. This allows the cacher to
    # differentiate between <tt>david.example.com/lists/</tt> and
    # <tt>jamis.example.com/lists/</tt> -- which is a helpful way of assisting
    # the subdomain-as-account-key pattern.
    #
    # Different representations of the same resource, e.g.
    # <tt>http://david.example.com/lists</tt> and
    # <tt>http://david.example.com/lists.xml</tt>
    # are treated like separate requests and so are cached separately.
    # Keep in mind when expiring an action cache that
    # <tt>:action => 'lists'</tt> is not the same as
    # <tt>:action => 'list', :format => :xml</tt>.
    #
    # You can modify the default action cache path by passing a
    # <tt>:cache_path</tt> option. This will be passed directly to
    # <tt>ActionCachePath.path_for</tt>. This is handy for actions with
    # multiple possible routes that should be cached differently. If a
    # block is given, it is called with the current controller instance.
    #
    # And you can also use <tt>:if</tt> (or <tt>:unless</tt>) to pass a
    # proc that specifies when the action should be cached.
    #
    # Finally, if you are using memcached, you can also pass <tt>:expires_in</tt>.
    #
    # The following example depicts some of the points made above:
    #
    #   class ListsController < ApplicationController
    #     before_filter :authenticate, :except => :public
    #
    #     caches_page :public
    #
    #     caches_action :index, :if => proc do
{'fraction_non_alphanumeric': 0.09030401151286202, 'fraction_numerical': 0.0007195538765965102, 'mean_word_length': 2.9017543859649124, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 67, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '929696', 'n_tokens_mistral': 1578, 'n_tokens_neox': 1541, 'n_words': 649}