• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Yoast / Yoast-SEO-for-TYPO3 / 18971787309

31 Oct 2025 11:55AM UTC coverage: 1.273% (-0.002%) from 1.275%
18971787309

push

github

RinyVT
[FEATURE] Feature toggle to completely disable cache for the page preview request to prevent edge-case caching issues

0 of 6 new or added lines in 1 file covered. (0.0%)

2 existing lines in 1 file now uncovered.

35 of 2749 relevant lines covered (1.27%)

0.04 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/Classes/Middleware/PageRequestMiddleware.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace YoastSeoForTypo3\YoastSeo\Middleware;
6

7
use Psr\Http\Message\ResponseInterface;
8
use Psr\Http\Message\ServerRequestInterface;
9
use Psr\Http\Server\MiddlewareInterface;
10
use Psr\Http\Server\RequestHandlerInterface;
11
use TYPO3\CMS\Core\Configuration\Features;
12
use TYPO3\CMS\Core\Context\Context;
13
use TYPO3\CMS\Core\Context\VisibilityAspect;
14
use TYPO3\CMS\Core\Utility\GeneralUtility;
15
use YoastSeoForTypo3\YoastSeo\Service\YoastRequestService;
16

17
class PageRequestMiddleware implements MiddlewareInterface
18
{
19
    public function __construct(
20
        protected YoastRequestService $yoastRequestService,
21
        protected Features $features,
UNCOV
22
    ) {}
×
23

24
    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
25
    {
NEW
26
        if (!$this->yoastRequestService->isValidRequest($request->getServerParams())) {
×
NEW
27
            return $handler->handle($request);
×
28
        }
29

NEW
30
        $context = GeneralUtility::makeInstance(Context::class);
×
NEW
31
        $context->setAspect('visibility', new VisibilityAspect(true));
×
32

NEW
33
        if ($this->features->isFeatureEnabled('yoastSeoDisableAllCachesOnPreviewRequest')) {
×
NEW
34
            $request = $request->withAttribute('noCache', true);
×
35
        }
36

UNCOV
37
        return $handler->handle($request);
×
38
    }
39
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc