[TYPO3-core] RFC #12130: Improve performance of flashmessages

Francois Suter fsu-lists at cobweb.ch
Tue Oct 6 13:40:07 CEST 2009


Hi,

> Problem:
> The current handling of flashmessages in the list module is very 
> unefficient and slows down the BE if there are a a lot of messages. 
> Every single flashmessage is stored in the DB causing a lot of database 
> load.
> 
> Solution:
> store the messages in a static object instead of using the DB.
> 
> Info:
> The patch introduces a new class t3lib_Messages which is used to collect 
> the flashmessages objects.

I'm sorry but this patch changes the behavior of flash messages. As 
Xavier mentions, flash messages are now a purely run-time thing. This 
means that you can't issue flash messages, redirect to another script 
and get the flash messages in that other script.

I agree that writing to the database is not optimal. I must say I hadn't 
noticed that TYPO3's "session" handling mechanism was purely 
database-based. I would store these messages in the PHP session.

Actually I've been using flash messages in my custom apps for a long 
time. In my API I have a double set of methods: one for writing to the 
current queue and one for writing into the session queue.

Now I agree that having a class to manage the queue is much better than 
having the work done by template.php. What we could now have is a method 
for storing to the PHP session. Then next time the message queue object 
is instantiated, it reads what's in the session, removes it from session 
and uses it to initialise the queue. Or maybe - to avoid instantiation - 
there could be a method to do that retrieval from session.

What do you think?

BTW I would rather name the class t3lib_MessageQueue.

Cheers

-- 

Francois Suter
Cobweb Development Sarl - http://www.cobweb.ch


More information about the TYPO3-team-core mailing list