Issue Feature Closed

#109121Allow client caching even if a plugin is on the page

Rémi Payette 02/28/26, 00:08 updated 03/03/26, 07:19

Description

Client caching is disabled when an extension plugin is used on the page, and as far as I can see, there’s no way to force allow it.

https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/TopLevelObjects/Config.html#confval-config-sendcacheheaders

  • No *_INT or *_EXT objects are on the page (e.g. USER and USER_INT)

Sometimes ( most of the times ? ), the condition that would make the content different, hence the “Cache-Control: private, no-store” header, is contained in the url variables of the request. It would make going “back”, reloading de same page from a shortcut or as in my case a common request cachable by a reverse proxy possible.

In my case, I have a “Recent articles” page that displays “search result” from apache-solr-for-typo3 with a fix query in typoscript that would greatly benefit from amazon cdn caching.

At least, it should be possible to override this if you know what you’re doing.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 8

  1. Garvin Hicking commented and changed status New Needs Feedback <span data-processor="relativetime" data-value="2026-02-28T08:16:49+00:00" > 02/28/26, 08:16 </span>

    Sometimes also CSP can prevent client caching due to the nonces.

    Please provide a minimal setup with a minimal extension that would show this behavior. My gut feeling is there’ll likely be a specific reason for this behavior.

  2. Rémi Payette commented <span data-processor="relativetime" data-value="2026-03-01T19:23:48+00:00" > 03/01/26, 19:23 </span>

    Minimal setup…

    Typo3 v13 + https://extensions.typo3.org/extension/solr installed, a “Search result” content element on a page with fixed query parameters.

    I think a lot of other similar plugins would work the same way and defeat client and proxy caching for no gain.

    If you want to see my case live : https://vitrinelinguistique.oqlf.gouv.qc.ca/actualites/breves

    Cache-Control: private, no-store, max-age=0

    The thing is that what make the page content vary are url variables based on the filters selected, which could easily be handled be the reverse proxy instead of making typo3, db and solr server requests each time a user go back to this page. My original problem is that bots are destroying my servers by requesting this page thousand of times from the origin typo3 server instead of from the proxy.

    And to the best of my knowledge, there is no way of telling typo3 I want this page publicly cached like any other except with some ugly header interception/filtering on an upstream server between typo3 and the client.

  3. Garvin Hicking commented <span data-processor="relativetime" data-value="2026-03-01T19:40:59+00:00" > 03/01/26, 19:40 </span>

    Ext:solr is quite a beast. Any chance you showcase this with a minimal extension? I do guesss solr will have the extbase actuon set as “uncached”.

    You could control this with a minimal middleware that just hooks at the very start, and there you could enrich the request with cache control headers. If another middlware overwrites them, only set a “pointer” in your initial middleware, and in theclast middleware overwrite the header with yours again.

    That should be a dozen lines or so of code – following the middleware routing is very poweful for situations like yours.

  4. Rémi Payette commented <span data-processor="relativetime" data-value="2026-03-01T20:11:15+00:00" > 03/01/26, 20:11 </span>

    I’ll try to reproduce with a simpler extension.

    And thanks for the middleware idea, I’ll try that also.

  5. Rémi Payette commented <span data-processor="relativetime" data-value="2026-03-02T18:19:06+00:00" > 03/02/26, 18:19 </span>

    - New ddev install of typo3 v13
    - Default settings, default basic site
    - composer req georgringer/news
    - add to typo3 root typoscript : config.sendCacheHeaders = 1
    - create page1 with a single text element
    - create page2 with a “News search form”

    page1 :

    Cache-Control: max-age=86400

    page2 :

    Cache-Control: private, no-store
  6. Garvin Hicking commented <span data-processor="relativetime" data-value="2026-03-02T20:39:48+00:00" > 03/02/26, 20:39 </span>

    Yes, because EXT:news lists that plugin as Uncached:

        ExtensionUtility::configurePlugin(
            'News',
            'NewsSearchForm',
            [
                NewsController::class => 'searchForm',
            ],
            [
                NewsController::class => 'searchForm',
            ],
            ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
        );
  7. Rémi Payette commented <span data-processor="relativetime" data-value="2026-03-02T22:25:06+00:00" > 03/02/26, 22:25 </span>

    ok, I didn’t knew that… it’s the same thing with tx_solr then.

    yet, I don’t see in what case it’s a good idea to also disable client caching. For the Typo3 page cache, ok, but for the client side, all the information is in the url ?tx_news_pi1[search][subject]=&tx_news_pi1[search][minimumDate]=2026-03-03&tx_news_pi1[search][maximumDate]=

    I’ll go the middleware request modification solution for now but it’s something that I think would be a good performance enhancement to add sometime.

  8. Garvin Hicking commented and changed status Needs Feedback Closed <span data-processor="relativetime" data-value="2026-03-03T07:19:43+00:00" > 03/03/26, 07:19 </span>

    Thanks for the feedback. Yes, indeed that is the case.

    The issue is this: If Extbase sees content on a page that should be uncached, it is needed to make the client not cache the data, because that is the desired behavior of an extbase plugin setting itself to “uncached”.

    If caching is wanted, the extbase plugin must be configured as ‘cachable’. Then a plugin can of course do its own caching, and/or adjust cache headers.

    If the client is allowed to cache data though that means that possible search results or article filtering will not yield updated data server-side.

    So I do think in your case with an edge-proxy it’s sensible that you use a middleware to adjust partial caching on your side. Because of this I’m closing the issue here.