Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
rahiparsi-stemcell opened this issue Oct 8, 2024 · 0 comments

Comments

@rahiparsi-stemcell
Copy link

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

@github-project-automation github-project-automation bot moved this to 🆕 Ready for Grooming in Commerce - Issues Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 Ready for Grooming
Development

No branches or pull requests

1 participant