logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

LWP::UserAgent::Role::CHICaching::SimpleMungeResponse - A role to manipulate the response when caching

Author

       Kjetil Kjernsmo <kjetilk@cpan.org>.

Description

       When caching, it is sometimes useful to change the response, in particular the body in some way for
       caching. In some cases, you might not want to store the entire body, but compress it in some way, or
       store the data in a different data structure than the serialized version shared over the network.

       The methods here are used to first manipulate the response before it is sent to the cache, and then a
       cached response before it is returned to the client.

   Methods
       "cache_set($response, $expires_in)"
           A  method  that  takes  the HTTP::Response from the client and an expires time in seconds and set the
           actual cache. This role's implementation stores the response as it is.

       finalize($cached)
           A method that takes the cached entry as an argument, and will return a HTTP::Response  to  return  to
           the client. This implementation returns the response directly from the cache.

Name

       LWP::UserAgent::Role::CHICaching::SimpleMungeResponse - A role to manipulate the response when caching

Synopsis

       See LWP::UserAgent::Role::CHICaching.

Todo

       The  standard  has  a  "no-transform" directive that is relevant to this, since roles such as this can be
       used to transform the response. This needs to be dealt with.

See Also