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

[DOCS] Adjust feature RST for CacheDataCollector API #1076

Open
TYPO3IncTeam opened this issue Oct 11, 2024 · 0 comments
Open

[DOCS] Adjust feature RST for CacheDataCollector API #1076

TYPO3IncTeam opened this issue Oct 11, 2024 · 0 comments
Labels

Comments

@TYPO3IncTeam
Copy link
Collaborator

ℹ️ View this commit on Github
👥 Authored by Torben Hansen [email protected]
✔️ Merged by Benjamin Franzke [email protected]

Commit message

[DOCS] Adjust feature RST for CacheDataCollector API

The RST for the CacheDataCollector API states, that the default
lifetime of a cache tag is 86400 seconds. This is however not
true, since the default lifetime is set to PHP_INT_MAX.

This change adjusts the feature RST for #102422.

Resolves: #105274
Related: #102422
Releases: main
Change-Id: I8c78e4a3891ac255e4fa4d997167edb1d6de7652
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/86555
Tested-by: Benjamin Franzke [email protected]
Tested-by: core-ci [email protected]
Tested-by: Sascha Nowak [email protected]
Reviewed-by: Sascha Nowak [email protected]
Reviewed-by: Benjamin Franzke [email protected]
Tested-by: Garvin Hicking [email protected]
Reviewed-by: Garvin Hicking [email protected]

➗ Modified files

13.3/Feature-102422-CacheDataCollectorApi.rst
@@ -19,8 +19,9 @@ The API is implemented as a new PSR-7 request attribute
 :php:`'frontend.cache.collector'`, which makes this API independent from TSFE.
 
 Every cache tag has a lifetime. The minimum lifetime is calculated
-from all given cache tags. API users don't have to deal with it individually.
-The default lifetime for a cache tag is 86400 seconds (24 hours).
+from all given cache tags. By default, the lifetime of a cache tag is set to
+:php:`PHP_INT_MAX`, so it expires many years in the future. API users must
+therefore define the lifetime of a cache tag individually.
 
 The current TSFE API is deprecated in favor of the new API, as the
 current cache tag API implementation does not allow to set lifetime and
@@ -30,13 +31,13 @@ Example
 -------
 
 ..  code-block:: php
-    :caption: Add a single cache tag
+    :caption: Add a single cache tag with 24 hours lifetime
 
     use TYPO3\CMS\Core\Cache\CacheTag;
 
     $cacheDataCollector = $request->getAttribute('frontend.cache.collector');
     $cacheDataCollector->addCacheTags(
-        new CacheTag('tx_myextension_mytable')
+        new CacheTag('tx_myextension_mytable', 86400)
     );
 
 ..  code-block:: php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant