AdobeDocs / AdobeDocs/commerce-php
The "Store data in a custom cache type" code example does NOT indicate the unit of time for the TTL argument
- Dominant language
- JavaScript
- Stars
- 11
- Forks
- 177
- PR merge metrics
- No merged PRs in 30d
Description
### Is there an existing issue for this?
- [X] 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_
Contributor guide
Research direction
Open the linked custom cache type topic and inspect the code example containing the 86400 TTL argument. Check the underlying Magento cache implementation to establish the time unit; done means the example explicitly states the unit and provides guidance for determining it when needed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100