---
title: "Public API"
manual: "Temporal Cache Management"
version: "main"
source: "Api/Index.rst"
rendered: "2026-10-07T14:40:31+00:00"
---

# Public API {#api}

This extension follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
from 1.0.0 onwards. That promise needs a boundary: without one, every class the
service container can reach would be frozen for the whole 1.x line.

This page is that boundary. What it lists as stable will not break in a minor or
patch release. Everything else is internal and may change at any time, even
though PHP's visibility rules do not stop you from calling it.

## Stable {#api-stable}

### Extension points {#extension-points}

Two service tags, and the interfaces behind them. Tag a service and the matching
factory picks it up — the strategy whose `getName()` equals the configured
value wins, and no code in this extension needs to know it exists.

-   **nr_temporal_cache.scoping_strategy**

    -   *Type:* service tag

    The tagged service must implement
    `NetresearchTemporalCacheServiceScopingScopingStrategyInterface`.
    It decides which cache tags a transition flushes.

-   **nr_temporal_cache.timing_strategy**

    -   *Type:* service tag

    The tagged service must implement
    `NetresearchTemporalCacheServiceTimingTimingStrategyInterface`.
    It decides whether a transition shortens the page cache lifetime, is handed
    to the scheduler task, or both.

**A third-party extension adding its own scoping strategy**

```yaml
services:
  Vendor\MyExtension\Scoping\MyScopingStrategy:
    tags:
      - { name: 'nr_temporal_cache.scoping_strategy' }
```

Both interfaces extend `NetresearchTemporalCacheServiceNamedStrategyInterface`,
which contributes `getName()`. Adding a method to any of the three would be
a breaking change and will not happen inside 1.x.

### Monitoring additional tables {#monitoring-additional-tables}

`NetresearchTemporalCacheServiceTemporalMonitorRegistry` — the methods
`registerTable()`, `isRegistered()`, `getAllTables()` and
`getTableFields()`.

Register in [`ext_localconf.php`](https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ExtensionArchitecture/FileStructure/ExtLocalconf.html#file-extension-ext-localconf-php), which is the recipe that works:

**EXT:my_extension/ext_localconf.php**

```php
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
    \Netresearch\TemporalCache\Service\TemporalMonitorRegistry::class
)->registerTable('tx_myext_domain_model_event', ['uid', 'pid', 'starttime', 'endtime']);
```

### Value objects {#value-objects}

`NetresearchTemporalCacheDomainModelTemporalContent` and
`NetresearchTemporalCacheDomainModelTransitionEvent`. Their readonly
properties are part of the API, because a scoping or timing strategy written
against the interfaces above receives them and reads those properties.

### Configuration keys {#configuration-keys}

The eleven keys in [`ext_conf_template.txt`](https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ExtensionArchitecture/FileStructure/ExtConfTemplate.html#file-extension-ext-conf-template-txt), documented in
[Optimization strategies](../Configuration/Strategies.html#configuration-strategies). Removing one is a breaking change; 0.9.0
removed `timing.scheduler_interval` for exactly that reason, before 1.0 made
it costly.

## Not stable {#api-not-stable}

Everything below is reachable through the container — several of these are
`public: true`, and TYPO3 forces every `SingletonInterface` implementation
public regardless of what `Services.yaml` says. Reachable is not the same
as supported:

-   `ConfigurationExtensionConfiguration` — read configuration through
    TYPO3's own API, not through this class.
-   `ServiceScopingScopingStrategyFactory`,
    `ServiceTimingTimingStrategyFactory` — resolve strategies for the
    extension itself.
-   the three shipped scoping strategies and the three shipped timing strategies
    as concrete classes. Depend on the interfaces, not on
    `GlobalScopingStrategy` and its siblings.
-   `ServiceRefindexService`, `ServiceHarmonizationService`,
    `ServiceCacheTransitionCache`, everything under :php:\`ServiceBackend\`.
-   `DomainRepositoryTemporalContentRepository` and
    `TemporalContentRepositoryInterface` — the interface exists so the
    extension's own tests can double it, not as an implementation contract for
    third parties.
-   `EventListenerTemporalCacheLifetime`, `TaskTemporalCacheSchedulerTask`,
    `ReportTemporalCacheStatusReport`,
    `ControllerBackendTemporalCacheController` — public so TYPO3 can
    instantiate them.
-   the console commands. Their names are stable; their classes are not.

## Deprecation policy {#api-deprecation-policy}

Anything listed under [Stable](#api-stable) is removed only in a major release, and
only after being marked `@deprecated` in a minor release first, with the
replacement named in the annotation and in the changelog. A deprecation stands
for at least one minor release before removal.

Behaviour can change in a minor release where the current behaviour is a defect
— 0.9.0 did this when hybrid timing began honouring both of its rules, and the
changelog said so under **Upgrade impact**. Such a change is always announced
there.

## Reading the annotations {#api-marker}

The code carries the same information:

-   `@api` marks a class, interface or method covered by this page.
-   `@internal` marks one that is not, whatever its PHP visibility.
-   An unannotated symbol is internal. When the two disagree, this page wins.
