Skip to content

Commit 27cbd76

Browse files
authored
[DOCS] Add section on how to optimize page index runtimes (#4334)
* [DOCS] Add section on how to optimize page index performance
1 parent 35a774d commit 27cbd76

2 files changed

Lines changed: 50 additions & 0 deletions

File tree

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
=============
2+
Best Practice
3+
=============
4+
5+
Optimize Page Indexing
6+
======================
7+
8+
Indexing of `pages` is usually done via this extensions `PageIndexer` which
9+
determines a pages content by crawling its URL and extracting everything between
10+
the two magic markers `<!--TYPO3SEARCH_begin-->` and `<!--TYPO3SEARCH_end-->`.
11+
When fetching the URL the header `X-Tx-Solr-Iq` is added to the request, which
12+
is (among other things) disabling all caches.
13+
14+
To reduce crawling runtimes you might wanna disable the rather expensive
15+
generation of navigation structures such as main and footer menus that you've
16+
defined for your `page` object in TypoScript.
17+
18+
You can do so by creating a TypoScript condition that unsets all sorts of
19+
non-content elements. Like this for example:
20+
21+
.. code-block:: typoscript
22+
23+
[request && traverse(request.getHeaders(), 'x-tx-solr-iq/0')]
24+
page.10.dataProcessing >
25+
page.10.variables >
26+
page.10.variables {
27+
content < styles.content.get
28+
content.select.where = {#colPos}=0
29+
contentMarginal < styles.content.get
30+
contentMarginal.select.where = {#colPos}=1
31+
}
32+
[global]
33+
34+
You should notice a significant difference right away:
35+
36+
37+
.. code-block:: bash
38+
39+
bin/typo3 scheduler:run --task=<tast-id-for-site> --force
40+
41+
or if EXT:solrconsole is installed on your system:
42+
43+
.. code-block:: bash
44+
45+
bin/typo3 solr:queue:index -n -a 1 -s <site>
46+
47+
If not: go to the TYPO3 backend and check the `page` object definition in the
48+
TypoScript object browser with that condition being activated to see what it
49+
looks like now.

Documentation/Development/Index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ There are many ways to extend and hook into EXT:solr to customize EXT:solr for y
1212

1313
Indexing
1414
Backend
15+
BestPractice
1516
Environment
1617
CI
1718
CodeStructure

0 commit comments

Comments
 (0)