[TYPO3-core] RFC #17167: Cache ExtDirect::getAPI calls

Ernesto Baschny [cron IT] ernst at cron-it.de
Fri Jan 21 18:54:56 CET 2011


Steffen Gebert schrieb am 21.01.2011 18:03:
> Hi Ernesto,
> 
> I used ySlow and that really only looks for Expires headers.
> 
>> This is a nice addition, but I cannot really see any effect this had on
>> the behaviour of the browsers. When I reload a frame every browser which
>> I tested were redoing the ExtDirect API ajax request regardless of these
>> headers. On other resources (served by APache) I see that the browser
>> gets back a "304 Not Modified", because the request is:
> While playing with the .htaccess stuff I also recognized differences
> between coming from cache and asking/getting 304.
> 
>> If-Modified-Since: Fri, 21 Jan 2011 15:39:39 GMT
>> If-None-Match: "279c4-edf64c0"
>>
>> So apache knows "nothing changed" and just sends 304.
> I found out that this behavior is cause by the Last-Modified header.
> When I unset it, then the requests really come from cache. Chrome shows
> this pretty nice.
> 
>> But for the ExtDirect::getAPI a regular "200" and the content is always
>> happily returned. So I wonder what effect those headers could have
>> (maybe for proxies in between?). Anyways its not bad that we have that
>> in!
> Yes, maybe the effect was really minor/nothing except a good ySlow
> rating ;)
> 
> Attached patch unsets the Last-modified and also the Pragma header. I
> search for sth. like header_remove, but didn't find it. Luckily, I found
> it now :)
> 
> Now chrome says: coming from cache :)
> 
> Could you test this, please?

header_remove() is PHP 5.3 only, I have 5.2 (and we require that too).
But it seem to be the same as doing:

   header('Last-Modified:');

And it seems to have helped, no more calls to ExtDirect::getAPI when
clicking around. Only when one do a explicit "reload" of the whole
backend, all those resources are fetched again (which caused me some
time to figure out that it works differently between clicking around and
hitting reload...).

So I would say, we commit this follow-up (PHP 5.2 compatible). Could you
last-check it and do it, please, Steffen? Thanks!

Cheers,
Ernesto


More information about the TYPO3-team-core mailing list