Skip to content

Commit e2fd3be

Browse files
authored
[TASK] Separate Caching backend and frontend pages (#6009)
There were even multiple page titles
1 parent 5de9fe8 commit e2fd3be

File tree

3 files changed

+127
-128
lines changed

3 files changed

+127
-128
lines changed
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
.. include:: /Includes.rst.txt
2+
3+
.. _caching-frontend:
4+
5+
===============
6+
Cache frontends
7+
===============
8+
9+
10+
.. _caching-frontend-api:
11+
12+
Frontend API
13+
============
14+
15+
All frontends must implement the API defined in interface :code:`TYPO3\CMS\Core\Cache\Frontend\FrontendInterface`.
16+
All operations on a specific cache must be done with these methods. The frontend object of a cache is the main object
17+
any cache manipulation is done with, usually the assigned backend object should not be used directly.
18+
19+
.. t3-field-list-table::
20+
:header-rows: 1
21+
22+
- :Method,30: Method
23+
:Description,70: Description
24+
25+
- :Method:
26+
getIdentifier
27+
:Description:
28+
Returns the cache identifier.
29+
30+
- :Method:
31+
getBackend
32+
:Description:
33+
Returns the backend instance of this cache. It is seldom needed in usual code.
34+
35+
- :Method:
36+
set
37+
:Description:
38+
Sets/overwrites an entry in the cache.
39+
40+
- :Method:
41+
get
42+
:Description:
43+
Returns the cache entry for the given identifier.
44+
45+
- :Method:
46+
has
47+
:Description:
48+
Checks for existence of a cache entry.
49+
Do no use this prior to :code:`get()` since :code:`get()`
50+
returns NULL if an entry does not exist.
51+
52+
- :Method:
53+
remove
54+
:Description:
55+
Removes the entry for the given identifier from the cache.
56+
57+
- :Method:
58+
flushByTag
59+
:Description:
60+
Flushes all cache entries which are tagged with the given tag.
61+
62+
- :Method:
63+
collectGarbage
64+
:Description:
65+
Calls the garbage collection method of the backend.
66+
This is important for backends which are unable to do this internally
67+
(like the DB backend).
68+
69+
- :Method:
70+
isValidEntryIdentifier
71+
:Description:
72+
Checks if a given identifier is valid.
73+
74+
- :Method:
75+
isValidTag
76+
:Description:
77+
Checks if a given tag is valid.
78+
79+
- :Method:
80+
requireOnce
81+
:Description:
82+
**PhpFrontend only** Requires a cached PHP file directly.
83+
84+
85+
.. _caching-frontend-avalaible:
86+
87+
Available Frontends
88+
===================
89+
90+
Currently two different frontends are implemented. The main difference are
91+
the data types which can be stored using a specific frontend.
92+
93+
94+
.. _caching-frontend-variable:
95+
96+
Variable Frontend
97+
-----------------
98+
99+
Strings, arrays and objects are accepted by this frontend.
100+
Data is serialized before it is passed to the backend.
101+
102+
.. tip::
103+
The variable frontend is the most frequently used frontend and handles
104+
the widest range of data types.
105+
106+
107+
.. _caching-frontend-php:
108+
109+
PHP Frontend
110+
------------
111+
112+
This is a special frontend to cache PHP files. It extends the string frontend
113+
with the method :code:`requireOnce()` which allows PHP files to be :code:`require()`'d
114+
if a cache entry exists. This can be used by extensions to cache and speed up loading
115+
of calculated PHP code and becomes handy if a lot of reflection and
116+
dynamic PHP class construction is done.
117+
118+
A backend to be used in combination with the PHP frontend must implement the interface
119+
:code:`TYPO3\CMS\Core\Cache\Backend\PhpCapableBackendInterface`. Currently the file backend and
120+
the simple file backend fulfill this requirement.
121+
122+
.. note::
123+
124+
The PHP frontend can **only** be used to cache PHP files.
125+
It does not work with strings, arrays or objects.
126+
It is **not** intended as a page content cache.

Documentation/ApiOverview/CachingFramework/FrontendsBackends/Index.rst

Lines changed: 0 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -1,133 +1,5 @@
11
.. include:: /Includes.rst.txt
22

3-
4-
5-
.. _caching-frontend:
6-
7-
===============
8-
Cache frontends
9-
===============
10-
11-
12-
.. _caching-frontend-api:
13-
14-
Frontend API
15-
============
16-
17-
All frontends must implement the API defined in interface :code:`TYPO3\CMS\Core\Cache\Frontend\FrontendInterface`.
18-
All operations on a specific cache must be done with these methods. The frontend object of a cache is the main object
19-
any cache manipulation is done with, usually the assigned backend object should not be used directly.
20-
21-
.. t3-field-list-table::
22-
:header-rows: 1
23-
24-
- :Method,30: Method
25-
:Description,70: Description
26-
27-
- :Method:
28-
getIdentifier
29-
:Description:
30-
Returns the cache identifier.
31-
32-
- :Method:
33-
getBackend
34-
:Description:
35-
Returns the backend instance of this cache. It is seldom needed in usual code.
36-
37-
- :Method:
38-
set
39-
:Description:
40-
Sets/overwrites an entry in the cache.
41-
42-
- :Method:
43-
get
44-
:Description:
45-
Returns the cache entry for the given identifier.
46-
47-
- :Method:
48-
has
49-
:Description:
50-
Checks for existence of a cache entry.
51-
Do no use this prior to :code:`get()` since :code:`get()`
52-
returns NULL if an entry does not exist.
53-
54-
- :Method:
55-
remove
56-
:Description:
57-
Removes the entry for the given identifier from the cache.
58-
59-
- :Method:
60-
flushByTag
61-
:Description:
62-
Flushes all cache entries which are tagged with the given tag.
63-
64-
- :Method:
65-
collectGarbage
66-
:Description:
67-
Calls the garbage collection method of the backend.
68-
This is important for backends which are unable to do this internally
69-
(like the DB backend).
70-
71-
- :Method:
72-
isValidEntryIdentifier
73-
:Description:
74-
Checks if a given identifier is valid.
75-
76-
- :Method:
77-
isValidTag
78-
:Description:
79-
Checks if a given tag is valid.
80-
81-
- :Method:
82-
requireOnce
83-
:Description:
84-
**PhpFrontend only** Requires a cached PHP file directly.
85-
86-
87-
.. _caching-frontend-avalaible:
88-
89-
Available Frontends
90-
===================
91-
92-
Currently two different frontends are implemented. The main difference are
93-
the data types which can be stored using a specific frontend.
94-
95-
96-
.. _caching-frontend-variable:
97-
98-
Variable Frontend
99-
-----------------
100-
101-
Strings, arrays and objects are accepted by this frontend.
102-
Data is serialized before it is passed to the backend.
103-
104-
.. tip::
105-
The variable frontend is the most frequently used frontend and handles
106-
the widest range of data types.
107-
108-
109-
.. _caching-frontend-php:
110-
111-
PHP Frontend
112-
------------
113-
114-
This is a special frontend to cache PHP files. It extends the string frontend
115-
with the method :code:`requireOnce()` which allows PHP files to be :code:`require()`'d
116-
if a cache entry exists. This can be used by extensions to cache and speed up loading
117-
of calculated PHP code and becomes handy if a lot of reflection and
118-
dynamic PHP class construction is done.
119-
120-
A backend to be used in combination with the PHP frontend must implement the interface
121-
:code:`TYPO3\CMS\Core\Cache\Backend\PhpCapableBackendInterface`. Currently the file backend and
122-
the simple file backend fulfill this requirement.
123-
124-
.. note::
125-
126-
The PHP frontend can **only** be used to cache PHP files.
127-
It does not work with strings, arrays or objects.
128-
It is **not** intended as a page content cache.
129-
130-
1313
.. _caching-backend:
1324

1335
===============

Documentation/ApiOverview/CachingFramework/Index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,5 +343,6 @@ TYPO3 Flow.
343343
QuickStart/Index
344344
Configuration/Index
345345
Architecture/Index
346+
Frontends/Index
346347
FrontendsBackends/Index
347348
Developer/Index

0 commit comments

Comments
 (0)