FriendsOfTYPO3 / frontend_editing

TYPO3 CMS Frontend Editing
https://friendsoftypo3.github.io/frontend_editing/
102 stars 39 forks source link

Redundant editor configuration requests #230

Closed webian closed 5 years ago

webian commented 7 years ago

Whenever a page is loaded in the frontend editing, for each inline editable field, there is one ajax request to get the editor configuration. By instance: index.php?ajaxID=/ajax/frontend-editing/editor-configuration&ajaxToken=88b4ca240ba387b1038a1ec70dc774fd6f2b09fa&page=1&table=tt_content&uid=165&field=bodytext

The inline editor of a field becomes available only when its request is completed.

These requests are in some way redundant because they differentiate by the uid of the CE. But it's rare if not impossible that the same DB table has different editor configuration for the same field based on a record uid. Instead there could be a single request for all the same fields of the same table.

A page with 10 tt_content CE with inline editable header and bodytext actually makes 20 ajax requests. Excluding the uid, the request could be reduced to 2, one for the header and one for the bodytext.

webian commented 7 years ago

NOTE: TYPO3 forces Cache-Control:no-cache, must-revalidate here https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/core/Classes/Authentication/AbstractUserAuthentication.php#L424

mabolek commented 5 years ago

Refined description:

1) Combine the configuration requests generated here into a single request: https://github.com/FriendsOfTYPO3/frontend_editing/blob/master/Resources/Public/JavaScript/Editor.js#L231-L274

2) Make sure the page is not editable until the configuration has been applied.