{
    "content": [
        {
            "type": "text",
            "text": "# HTML::Mason::Cache::BaseCache (perldoc)\n\n## NAME\n\nHTML::Mason::Cache::BaseCache - Base cache object\n\n## DESCRIPTION\n\nThis is the base module for all cache implementations used in Mason. It provides a few\nadditional methods on top of \"Cache::BaseCache\" in Dewitt Clinton's \"Cache::Cache\" package.\n\n## Sections\n\n- **NAME**\n- **DESCRIPTION**\n- **METHODS**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "HTML::Mason::Cache::BaseCache",
        "section": "",
        "mode": "perldoc",
        "summary": "HTML::Mason::Cache::BaseCache - Base cache object",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 40,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "HTML::Mason::Cache::BaseCache - Base cache object\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This is the base module for all cache implementations used in Mason. It provides a few\nadditional methods on top of \"Cache::BaseCache\" in Dewitt Clinton's \"Cache::Cache\" package.\n\nAn object of this class is returned from $m->cache.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "clear ()\nRemove all values in the cache.\n\nget (key, [%params])\nReturns the value associated with *key* or undef if it is non-existent or expired. This is\nextended with the following optional name/value parameters:\n\nbusylock => duration\nIf the value has expired, set its expiration time to the current time plus *duration*\n(instead of removing it from the cache) before returning undef. This is used to prevent\nmultiple processes from recomputing the same expensive value simultaneously. The\n*duration* may be of any form acceptable to set.\n\nexpireif => sub\nIf the value exists and has not expired, call *sub* with the cache object as a single\nparameter. If *sub* returns a true value, expire the value.\n\ngetobject (key)\nReturns the underlying \"Cache::Object\" object associated with *key*. The most useful methods\non this object are\n\n$co->getcreatedat();    # when was object stored in cache\n$co->getaccessedat();   # when was object last accessed\n$co->getexpiresat();    # when does object expire\n\nexpire (key)\nExpires the value associated with *key*, if it exists. Differs from remove only in that the\ncache object is left around, e.g. for retrieval by getobject.\n\nremove (key)\nRemoves the cache object associated with *key*, if it exists.\n\nset (key, data, [duration])\nAssociates *data* with *key* in the cache. *duration* indicates the time until the value\nshould be erased. If *duration* is unspecified, the value will never expire by time.\n\n*$expiresin* may be a simple number of seconds, or a string of the form \"[number] [unit]\",\ne.g., \"10 minutes\". The valid units are s, second, seconds, sec, m, minute, minutes, min, h,\nhour, hours, d, day, days, w, week, weeks, M, month, months, y, year, and years.\n",
                "subsections": []
            }
        }
    }
}