[TYPO3-english] How to add Last-Modified to header
Patrick Broens
patrick.broens at typo3.org
Fri May 1 16:32:33 CEST 2015
Hi Ilya,
The Last-Modified header has recently been taken out by me, because the
whole approach was broken by design. I don't know which version you are
using, but it is gone since the latest version 7.2 and 6.2.12.
I'm not going to sum up the whole story (I have a document of a few
pages describing the problem), but you could get in big problems when
you are using this header. Pages will never be cleared in the browser
cache of your visitors, which will lead to unexpected things.
Imagine you have page A: showing news records or other content from a
different page or folder B. In page B the changes are noticed by the
system, but not in page A. When you are not changing anything on page A
for a long time, the Last-Modified header will stay on the same date
forever. I had this with a very big university website. Totally uncool
and you don't know what is happening.
As I wrote, it is broken by design and hard to get it right in the TYPO3
CMS core.
Still, the ETag header is there, serving kind of the same purpose.
But you are writing you are using 6.2.9. If the ETag and Last-Modified
header are not there, then they are removed probably by the webserver,
not TYPO3 CMS. When using Apache it is possible to remove them using
.htaccess with mod_headers, like "Header unset Last-Modified".
And keep in mind pages should be cached in the TYPO3 cache, otherwise
these headers will not be send at all. I do not see the Expires header
or Cache-Control with a max-age, which tells me that you are not caching
the page, so it is not allowed to be cached client side as well.
Cheers
Patrick
On 30-4-15 15:30 , Ilya Smirnoff wrote:
> Nobody knows?
> Or usual this header must be add by default?
>
> 2015-04-29 22:42 GMT+03:00 Ilya Smirnoff <ilya.smirnoff at gmail.com>:
>
>> Hello!I tring add Last-Modified to header of my site based on TYPO3 6.2.9
>> and RealURL.
>> But not success :(
>> I add to my TS setup this:
>> config
>> {
>> no_cache = 0
>> sendCacheHeaders=1
>> enableContentLengthHeader = 1
>> cache_period = 100
>> cache_clearAtMidnight = 1
>> }
>> But it's doesn't work for me and server answer is:
>> HTTP/1.1 200 OK
>> Date: Wed, 29 Apr 2015 10:54:31 GMT
>> Server: Apache/2.2.22 (Debian)
>> X-Powered-By: PHP/5.5.20-1~dotdeb.1
>> Cache-Control: private
>> Content-Length: 195968
>> Vary: Accept-Encoding
>> Connection: close
>> Content-Type: text/html; charset=utf-8
>>
>> How I can add something like this:
>> Last-Modified: Wed, 29 Apr 2015 10:48:39 GMT
>>
>> Thanks in advance.
>> _______________________________________________
>> TYPO3-english mailing list
>> TYPO3-english at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english
>>
--
Patrick Broens
TYPO3 Core Team member
TYPO3 .... inspiring people to share!
Get involved: typo3.org
More information about the TYPO3-english
mailing list