I was considering adding auto serialization of reference keys to CHI.
That means you could do, e.g.
$cache->set(\%params, "some value");
and it would automatically serialize \%params into a scalar key. This
is useful if you want to cache based on all the parameters to a
method, for example. Too often I've seen code doing a half-baked,
error prone serialization like
$cache->set(join(':', $params{foo}, $params{bar}), ...);
I figured I would use a compact Data::Dumper to serialize the key, for
readability's sake in case you call get_keys, and also to maintain
compatibility with drivers that might not like arbitrary binary keys.
But memcached doesn't even allow whitespace or control characters in
keys, so there might have to be an additional digest (e.g. md5)
performed on the key for memcached.
Is this a good/bad idea? Feedback welcome.
Jon
--
You received this message because you are subscribed to the Google Groups "Perl-Cache Discuss" group.
To post to this group, send email to
perl-cach...@googlegroups.com.
To unsubscribe from this group, send email to
perl-cache-disc...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/perl-cache-discuss?hl=en.