Optimization strategies
Reference for the scoping, timing and harmonization settings. Each setting is listed with the type, the default and the behaviour the extension code derives from it.
For guidance on which combination suits which site, see Optimization strategies.
How the settings combine
The scoping strategy answers two questions, and the timing strategy decides which of the two answers is ever used:
- Cache lifetime
Scopingreturns the next transition timestamp. The event listener caps the page cache lifetime at that timestamp. Only theStrategy Interface:: get Next Transition () dynamictiming strategy — andhybridwhen its page rule isdynamic— asks for it.- Cache tags
Scopingreturns the tags a transition flushes. Only the scheduler task callsStrategy Interface:: get Cache Tags To Flush () Timing, so these tags take effect with theStrategy Interface:: process Transition () schedulerandhybridtiming strategies.Dynamicis empty.Timing Strategy:: process Transition ()
A scoping strategy whose benefit lies in its tags therefore has no effect while
timing..
Scoping strategy
Controls which caches are invalidated when temporal transitions occur.
-
- type
-
string
- Default
-
global - Path
-
$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['nr_temporal_cache']['scoping']['strategy']
Selects the scoping strategy by its
get. Accepted values areName () global,per-andpage per-. A value matching no registered strategy activates the tagged strategy with the highest priority, which iscontent global.global- Next transition: the earliest transition in any monitored table, for the
current workspace and language.
Cache tags:
pages— every page cache is flushed. per-page - Next transition: the earlier of the next transition in the
pagestable site-wide and the next content transition on the page being rendered. Page transitions stay site-wide because a page appearing or disappearing changes menus everywhere. Without a page id, for example on the command line, the site-wide transition is used. Cache tags:pagefor a page record,Id_<uid> pagefor a content element.Id_<pid> per-content - Next transition: the site-wide transition, the same value
globalreturns. Content can be referenced onto arbitrary pages, so narrowing the lifetime per page would risk serving stale embedded content. Cache tags:pagefor a page record; for a content element, one tag per page that references it, resolved throughId_<uid> sys_;refindex pagefor a record of another registered table.Id_<pid>
The per-content precision lives entirely in the tags, so this strategy changes nothing while
timing.. Combine it withstrategy = dynamic schedulerorhybridtiming.Example -------
# Extension Manager configuration scoping.strategy = per-contentCopied!
-
- type
-
boolean
- Default
-
true - Path
-
$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['nr_temporal_cache']['scoping']['use_refindex']
Read by the
per-scoping strategy only. The other two strategies ignore it.content When enabled:
PerasksContent Scoping Strategy Refindexfor every page that references the content element and returns one cache tag per page.Service When disabled:
The lookup is skipped and the strategy flushes the content element's own page (
pid) only, which is whatper-does.page The same fallback to
pidapplies when the reference index lookup returns no pages or throws, so a stalesys_degrades the result instead of dropping the invalidation. Keep the reference index current withrefindex vendor/.bin/ typo3 referenceindex: update Example -------
# Extension Manager configuration scoping.use_refindex = 1Copied!
Timing strategy
Controls when the extension checks for temporal transitions.
-
- type
-
string
- Default
-
dynamic - Path
-
$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['nr_temporal_cache']['timing']['strategy']
Selects the timing strategy by its
get. Accepted values areName () dynamic,schedulerandhybrid. A value matching no registered strategy activates the tagged strategy with the highest priority, which isdynamic.dynamic- Calculates a cache lifetime on every page cache generation and caps the
page cache at the next transition.
With no transition ahead it returns
advanced.; a transition already in the past yields 60 seconds. Transitions are not processed separately — the cache simply expires.default_ max_ lifetime scheduler- Returns no lifetime, so the extension leaves the page cache lifetime untouched and TYPO3's own cache period applies. Invalidation happens when the scheduler task processes a transition and flushes the scoping strategy's cache tags. Requires the scheduler task, see Scheduler task.
hybrid- Delegates per content type to the dynamic or the scheduler strategy,
configured through
timing.andhybrid. pages timing..hybrid. content
Example -------
# Extension Manager configuration # Flush through the scheduler task timing.strategy = scheduler # Or split the two content types timing.strategy = hybrid timing.hybrid.pages = dynamic timing.hybrid.content = schedulerCopied!
-
- type
-
string
- Default
-
dynamic - Path
-
$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['nr_temporal_cache']['timing']['hybrid']['pages']
Rule for records in the
pagestable, whose content type ispage. Accepted values aredynamicandscheduler; any other value falls back todynamic. Only read whentiming..strategy = hybrid This rule does double duty. Besides routing page transitions, it is the rule
Hybridconsults on every page cache generation, because at that point the individual content elements of the page are not known. Leaving it atTiming Strategy:: get Cache Lifetime () dynamictherefore keeps the lifetime calculation running for every cached page; setting it toschedulerremoves the lifetime calculation for the whole site.Note
The configuration key is
pages, the content type it maps to ispage.Extensionperforms that mapping, so the rule reachesConfiguration:: get Timing Rules () Hybrid, which looks rules up byTiming Strategy Temporal.Content:: get Content Type () Example -------
timing.strategy = hybrid timing.hybrid.pages = dynamicCopied!
-
- type
-
string
- Default
-
scheduler - Path
-
$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['nr_temporal_cache']['timing']['hybrid']['content']
Rule for records in every monitored table other than
pages, whose content type iscontent. Accepted values aredynamicandscheduler; any other value falls back todynamic. Only read whentiming..strategy = hybrid This rule routes content transitions to the strategy it names — the scheduler task when set to
scheduler, the dynamic strategy when set todynamic— and it also contributes to the page cache lifetime.Hybridasks the strategies both rules resolve to and takes the earliest non-null answer, because a rendered page depends on the page record and on the content on it alike. Setting this rule toTiming Strategy:: get Cache Lifetime () dynamictherefore keeps content transitions capping the page cache lifetime even whentiming..hybrid. pages = scheduler Example -------
timing.strategy = hybrid timing.hybrid.content = schedulerCopied!
Time harmonization
Rounds transition timestamps to fixed time slots so that several transitions share one cache flush.
-
- type
-
boolean
- Default
-
false - Path
-
$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['nr_temporal_cache']['harmonization']['enabled']
Master switch for
Harmonization.Service When disabled:
harmonizereturns every timestamp unchanged, the Content tab of the backend module hides its harmonization column, and theTimestamp () harmonizeAJAX endpoint refuses the request.When enabled:
Timestamps are moved to the nearest configured slot, subject to
harmonization.. Harmonization is applied where it is invoked — by thetolerance Harmonize selectedaction in the backend module and by thevendor/command, both of which writebin/ typo3 temporalcache: harmonize starttimeandendtimeback to the record. It does not silently rewrite records that editors save.Example -------
harmonization.enabled = 1Copied!
-
- type
-
string
- Default
-
00:00,06: 00,12: 00,18: 00 - Path
-
$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['nr_temporal_cache']['harmonization']['slots']
Comma-separated list of times of day on a 24-hour clock. Both
HH:and a single-digit hour (MM H:) are accepted, soMM 8:and00 08:are equivalent. Surrounding whitespace is trimmed and the list is sorted internally. An entry that matches neither form, or whose hours exceed 23 or minutes exceed 59, is dropped without an error; if that leaves no slot at all, harmonization returns every timestamp unchanged.00 The slots repeat every day and distances are measured on the circular day, so the nearest slot may be the previous or the next day's occurrence: with slots at 00:00 and 18:00, 23:30 is 30 minutes from the next day's 00:00, not 5 hours 30 minutes from today's 18:00. A harmonized timestamp can therefore land on the adjacent calendar day. Times of day are read in UTC —
Harmonizationbuilds itsService Datefrom a Unix timestamp, which PHP always interprets as UTC regardless of the server timezone.Time Examples --------
# Every 6 hours (4 slots per day) harmonization.slots = 00:00,06:00,12:00,18:00 # Every 4 hours (6 slots per day) harmonization.slots = 00:00,04:00,08:00,12:00,16:00,20:00 # Business hours only harmonization.slots = 08:00,12:00,17:00Copied!
-
- type
-
integer
- Default
-
3600 - Path
-
$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['nr_temporal_cache']['harmonization']['tolerance']
Largest shift in seconds that harmonization may apply. A timestamp is moved to its nearest slot only when the distance to that slot is at most this many seconds; anything further away is returned unchanged.
Warning
0does not mean "no limit". With a tolerance of0only a timestamp that already sits exactly on a slot passes the check, so harmonization changes nothing at all. The label inext_conf_template.txtstill reads0 = no limitand is wrong.temporalcache:treats a tolerance outside 1-86400 as invalid.verify Example behaviour (slots
00:, tolerance00,12: 00 3600):11:30 → nearest slot 12:00, distance 30 min → harmonized to 12:00 12:45 → nearest slot 12:00, distance 45 min → harmonized to 12:00 10:30 → nearest slot 12:00, distance 90 min → left at 10:30Copied!When two slots are equally distant, the later one wins.
Examples --------
# Allow up to 1 hour shift (default) harmonization.tolerance = 3600 # Stricter: max 30 minutes shift harmonization.tolerance = 1800Copied!
-
- type
-
boolean
- Default
-
false - Path
-
$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['nr_temporal_cache']['harmonization']['auto_round']
Declares that harmonized times should be suggested while editing.
Note
The value is read and reported — by the Reports module status provider, by
temporalcache:and byanalyze temporalcache:— but no backend form acts on it in this version. Harmonization suggestions are shown in the Content tab of the backend module, which is gated byverify harmonization., not by this setting.enabled Example -------
harmonization.auto_round = 1Copied!
Next steps
- Advanced options - Cache lifetime cap, debug logging, scheduler task
- Examples & presets - Complete configuration examples
- Optimization strategies - Which combination suits which site