[TYPO3-dev] Typoscript

Philipp Gampe philipp.gampe at typo3.org
Sun May 11 23:32:26 CEST 2014


Hi Heinz,

Heinz Müller wrote:

> there is a little question that bothers me recently. I don't really
> understand how typoscript is stored in the system and how it is loaded.
> 
> In my case, I'm writing an extension. Now what I want to know is if the
> typoscript configuration must be read and parsed each time a user requests
> a page? Or is there some kind of caching of typoscript? If yes, how is
> this done? Are the individual typoscript settings stored in the database?

First of all, TypoScript (TS) is a syntax and a configuration format to 
create a large PHP array.
Second, you need to differentiate between Frontend and Backend.

For the frontend, TYPO3 CMS tries to fully cache a page, based on the 
request parameters and potential TS conditions.
If no cache entry exists, then the full TS is parsed. The TS is stored in 
the database in so called Template records. Those records may include any 
valid TS syntax, including directives to load additional TS definitions from 
files.
For easier maintenance, it is advised to move the majority of TS definitions 
into files, such that they can be versioned and exchanged.

Backend TS is stored in the database too, but a bit more cluttered. The 
PageTS is stored in each page record in the respective field and the UserTS 
is stored in either the usergroup record or the user record.
They are then merged together.

If you are serving a frontend request, then the fully parsed TS will be 
available in the frontend controller object in the config variable (TSFE-
>config).

The the backend, you can get it my asking the backend utility. The backend 
has a runtime cache

Due to the nature of TS, it is not possible to cache it, because the 
resulting array might be different depending on conditions. On top of that, 
the TS may be different for each page in the page tree.

Best regards
-- 
Philipp Gampe – PGP-Key 0AD96065 – TYPO3 UG Bonn/Köln
Documentation – Active contributor TYPO3 CMS
TYPO3 .... inspiring people to share!




More information about the TYPO3-dev mailing list