Skip to content

The "Store data in a custom cache type" code example does NOT indicate the unit of time for the TTL argument #321

@rahiparsi-stemcell

Description

@rahiparsi-stemcell

Is there an existing issue for this?

  • I have searched the existing issues

Which topic?

https://developer.adobe.com/commerce/php/development/cache/partial/cache-type/

What's wrong with the content?

The code example given for saving data in a custom cache type does not indicate the unit of time the TTL argument.
This is the example:

$cacheKey  = \VendorName\ModuleName\Model\Cache\Type\CacheType::TYPE_IDENTIFIER;
$cacheTag  = \VendorName\ModuleName\Model\Cache\Type\CacheType::CACHE_TAG;

$storeData = $this->cache->save(
    $this->serializer->serialize($cacheData),
    $cacheKey,
    [$cacheTag],
    86400
);

Is 86400 in seconds? In minutes? etc
The underlying magento code itself also does not indicate the unit of time.

What changes do you propose?

Update the code example to explicitly state what unit of time magento is using, or if that's not easily discernible then at least provide explanations and guidance on how to find out.
It's important to know the unit of time.

Anything else that can help to cover this?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    🆕 Ready for Grooming

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions