1) Sure, but realize that a cache is meant to be transitory. It's not where you should be keeping anything you really care about like an order or something where losing cache data might mean losing money. Some of the caches engines are less likely than others to dump data on their own. IIRC, FileCache is one of the ones that is not going to do it.

2) Of course.

3) $user is just going to be something like "Egil Kveldulfr." Or better, a user id, like 1005. It's just a unique key (or it's not safe because a user might see another user's cache data) for the user. The $customer is just some theoretical data object, like a DBIx::Class object of a customer account and its related data like orders.

That is a working example you gave, I think. You just need to fill in the data. I'd try something more simple to start... Oh, I see mortiz just replied. His advice is good: play with the test files.


In reply to Re: Cache::Cache questions by Your Mother
in thread Cache::Cache questions by vit

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.