How it works¶
In short this extension is performing following steps:
1. First the extension checks for situations that do NOT have impact on cache:¶
- The hidden news was created
If the news has been just created and has 'hidden' field set on then it should not have impact on cache.
- The hidden news was updated
If the news is hidden then its changes are not visible so it should not have impact on cache.
- The hidden news was deleted
If the news is hidden then it has been removed from LIST,LATEST and SINGLE views already. So If we delete record that was hidden it should not have impact on cache.
2. If one of the above did not occur then extension reads buffered views information¶
It reads it from file in typo3temp/ttnewscache/view_info or if this file doesn't exist it generates views information and saves for later use. File with buffered information is deleted and regenerated on next tt_news record change if:
- Page TSconfig will change,
- plugin tt_news inside content element will change.
3. In next step the extension is looking for related news (if bidirectional relations is on).¶
4. Then the extension search for views that match categories of the news. If there is no match on categories then caches will not be cleared at all.¶
Note on category match
If you have more than one SINGLE VIEW and there is possibility to set categories and category mode to those views then it is reasonable to do so. This has performance impact in some method of cache clearing.
5. If there are match on categories then the extension does analyze what fields have been modified.¶
How it works?
Fields in tt_news record can be divided into 2 classes:
- Fields that make clear cache of all pages where the view appears.
By default these fields are: datetime, category, hidden. The same fields for LIST an LATEST.
EXAMPLE: You have LIST view with pagebrowser. There are 2000 news - 10 per page so 200 pages in cache. If you change datetime of the news then all 200 pages, which have this LIST view, must be cleared because position of the news in the list may change.
- Fields that make clear cache of specific view pages.
By default they are:
For the LIST: title, bodytext, short, image, imagecaption, imagealttext ,imagetitletext, tx_damnews_dam_images
For the LATEST: title
EXAMPLE: You have LIST view with pagebrowser. There are 2000 news - 10 per page so 200 pages in cache. If you change title of one news then only this specific page with this news title must be cleared. All other 199 cached pages of the view remain untouched.
Of course it may vary and it depends what group the field belongs to. In some installation the author field can be in LIST view. That's why you may decide which fields belongs to which group in each type of view and in each specific view. You can also set what fields will clear related news. There are TypoScript settings for that. See TypoScript Reference of this extension for more details.
Note that SINGLE view of changed news is always set to clear no matter of field changed.