TYPO3 7.6.x:启用last-modified响应头配置无效求助
Fixing Last-Modified Header Not Working in TYPO3 7.6.x
Hey there! Let's get that Last-Modified header showing up in your TYPO3 7.6.x site's responses. The config you've added so far sets up basic cache headers, but it's missing the key setting to enable the Last-Modified field specifically.
Step 1: Add the Missing TypoScript Setting
You need to add sendLastModifiedHeader = 1 to your root template's config section. This tells TYPO3 to generate and send the Last-Modified header based on the page's last modification timestamp.
Here's your updated config block:
config { contentObjectExceptionHandler = 0 no_cache = 0 sendCacheHeaders = 1 sendLastModifiedHeader = 1 # This is the missing line! enableContentLengthHeader = 1 cache_period = 3600 cache_clearAtMidnight = 1 }
Step 2: Verify Key Prerequisites
Even with the right config, a few things might block the header from appearing:
- Clear all caches: TYPO3's internal cache might be holding old responses. Head to the TYPO3 backend, click the "Flush all caches" button in the top-right corner to refresh everything.
- Check page-level cache settings: Ensure individual pages aren't set to
no_cache(this overrides the root config). You can check this in the page properties under the "Cache" tab. - Test with raw requests: Use tools like
curl -I your-page-urlto check response headers directly—browser dev tools might show cached headers that don't reflect your new config. Look for theLast-Modifiedline in the output.
Step 3: Troubleshoot Edge Cases
If the header still doesn't show up:
- Disable non-essential third-party extensions temporarily—some security or performance plugins might modify or strip response headers.
- Check your web server (Apache/Nginx) configs. For example, some Nginx cache setups might add their own headers that take precedence over TYPO3's.
内容的提问来源于stack exchange,提问作者MAZ
相关产品推荐
相关产品推荐

