[!!!][TASK] Remove DB field pages.no_cache 89/54489/4
authorBenni Mack <benni@typo3.org>
Fri, 27 Oct 2017 19:22:21 +0000 (21:22 +0200)
committerSusanne Moog <susanne.moog@typo3.org>
Mon, 30 Oct 2017 07:22:57 +0000 (08:22 +0100)
Having an option to completely disable the page rendering
cache available per page for editors is a real risk. This
option is largely hard to understand for an editor,
or an admin.

Integrators can still use `config.no_cache = 1` in
TypoScript on a condition basis to achieve the same
result.

Resolves: #82878
Releases: master
Change-Id: Ie6989acc0044a75e711253e4304f9b2b9d96a7e1
Reviewed-on: https://review.typo3.org/54489
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Henning Liebe <h.liebe@neusta.de>
Tested-by: Henning Liebe <h.liebe@neusta.de>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
typo3/sysext/core/Classes/TypoScript/TemplateService.php
typo3/sysext/core/Configuration/TCA/pages.php
typo3/sysext/core/Documentation/Changelog/master/Breaking-82878-RemovedFieldNoCacheInDatabaseTablePages.rst [new file with mode: 0644]
typo3/sysext/core/Resources/Private/Language/locallang_csh_pages.xlf
typo3/sysext/core/Tests/Functional/Tca/PagesVisibleFieldsTest.php
typo3/sysext/core/ext_tables.sql
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
typo3/sysext/frontend/Resources/Private/Language/locallang_tca.xlf
typo3/sysext/frontend/Tests/Functional/Tca/PagesLanguageOverlayVisibleFieldsTest.php
typo3/sysext/info/Classes/Controller/PageInformationController.php

index c1943df..2989a73 100644 (file)
@@ -1431,7 +1431,7 @@ class TemplateService
      * Basically this function takes care of issues such as type,id,alias and Mount Points, URL rewriting (through hooks), M5/B6 encoded parameters etc.
      * It is important to pass all links created through this function since this is the guarantee that globally configured settings for link creating are observed and that your applications will conform to the various/many configuration options in TypoScript Templates regarding this.
      *
-     * @param array $page The page record of the page to which we are creating a link. Needed due to fields like uid, alias, target, no_cache, title and sectionIndex_uid.
+     * @param array $page The page record of the page to which we are creating a link. Needed due to fields like uid, alias, target, title and sectionIndex_uid.
      * @param string $oTarget Default target string to use IF not $page['target'] is set.
      * @param bool $no_cache If set, then the "&no_cache=1" parameter is included in the URL.
      * @param string $_ not in use anymore
@@ -1491,7 +1491,7 @@ class TemplateService
         // Preserving the type number.
         $LD['orig_type'] = $LD['type'];
         // noCache
-        $LD['no_cache'] = trim($page['no_cache']) || $no_cache ? '&no_cache=1' : '';
+        $LD['no_cache'] = $no_cache ? '&no_cache=1' : '';
         // linkVars
         if ($addParams) {
             $LD['linkVars'] = GeneralUtility::implodeArrayForUrl('', GeneralUtility::explodeUrl2Array($this->getTypoScriptFrontendController()->linkVars . $addParams), '', false, true);
index 74c418b..99fc3a6 100644 (file)
@@ -59,7 +59,7 @@ return [
         'searchFields' => 'title,alias,nav_title,subtitle,url,keywords,description,abstract,author,author_email'
     ],
     'interface' => [
-        'showRecordFieldList' => 'doktype,title,alias,hidden,starttime,endtime,fe_group,url,target,no_cache,shortcut,keywords,description,abstract,newUntil,lastUpdated,cache_timeout,cache_tags,backend_layout,backend_layout_next_level',
+        'showRecordFieldList' => 'doktype,title,alias,hidden,starttime,endtime,fe_group,url,target,shortcut,keywords,description,abstract,newUntil,lastUpdated,cache_timeout,cache_tags,backend_layout,backend_layout_next_level',
         'maxDBListItems' => 30,
         'maxSingleDBListItems' => 50
     ],
@@ -436,18 +436,6 @@ return [
                 'eval' => ''
             ]
         ],
-        'no_cache' => [
-            'exclude' => true,
-            'label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.no_cache',
-            'config' => [
-                'type' => 'check',
-                'items' => [
-                    '1' => [
-                        '0' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.no_cache_checkbox_1_formlabel'
-                    ]
-                ]
-            ]
-        ],
         'no_search' => [
             'exclude' => true,
             'label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.no_search',
@@ -947,7 +935,7 @@ return [
             'showitem' => 'layout, lastUpdated, newUntil, no_search'
         ],
         '3' => [
-            'showitem' => 'alias, target, no_cache, cache_timeout, cache_tags'
+            'showitem' => 'alias, target, cache_timeout, cache_tags'
         ],
         '5' => [
             'showitem' => 'author, author_email',
@@ -1039,7 +1027,7 @@ return [
         ],
         'caching' => [
             'label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.caching',
-            'showitem' => 'cache_timeout;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.cache_timeout_formlabel, cache_tags, no_cache;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.no_cache_formlabel',
+            'showitem' => 'cache_timeout;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.cache_timeout_formlabel, cache_tags',
         ],
         'language' => [
             'label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.language',
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-82878-RemovedFieldNoCacheInDatabaseTablePages.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-82878-RemovedFieldNoCacheInDatabaseTablePages.rst
new file mode 100644 (file)
index 0000000..0df4cd5
--- /dev/null
@@ -0,0 +1,43 @@
+.. include:: ../../Includes.txt
+
+=====================================================================
+Breaking: #82878 - Removed field "no_cache" in database table "pages"
+=====================================================================
+
+See :issue:`82878`
+
+Description
+===========
+
+The database field "pages.no_cache" has been removed from TYPO3 Core. This option allowed editors
+to completely disable all frontend caching functionality of a specific page.
+
+
+Impact
+======
+
+Having this option previously set on a specific page will now use caching when rendering this page.
+
+
+Affected Installations
+======================
+
+Existing installations having this option set in their database.
+
+This can easily be checked via a SQL query: `SELECT uid, pid, title, FROM pages WHERE deleted=0
+AND pid>=0 AND no_cache=1;`.
+
+
+Migration
+=========
+
+The "no cache" option which should be avoided or otherwise used carefully by integrators via
+TypoScript through `config.no_cache = 1` in conjunction with a condition on a per-page basis.
+
+However, it is better to set a very low cache timeout, or investigate why caching is configured
+wrongly in an extension or plugin.
+
+Also, use the SQL query to quickly check if your installation is even using this option at all.
+If not, it is not necessary to migrate anything.
+
+.. index:: Database, Frontend, NotScanned
\ No newline at end of file
index e6e2ee3..b267c1f 100644 (file)
@@ -139,18 +139,6 @@ Combined:
 100 600x350 - Opens the page in a 600x350 popup with type=100
 2 _blank - Opens the page with target "_blank" and type=2</source>
                        </trans-unit>
-                       <trans-unit id="no_cache.description">
-                               <source>This option disables server caching of the page.</source>
-                       </trans-unit>
-                       <trans-unit id="no_cache.details" xml:space="preserve">
-                               <source>Normally pages in TYPO3 are cached on the server after being constructed for the first time. This means a page is displayed much faster the second time it's requested.
-For most pages this presents no problems; indeed, it boosts the performance of the website.
-However you may need to disable caching for a page if it contains dynamic content which must not be cached under any circumstances. Normally the PHP-code rendering such content is programmed to disable the caching automatically. But with this option you can force the page not to be cached.</source>
-                       </trans-unit>
-                       <trans-unit id="_no_cache.seeAlso">
-                               <source>pages:cache_timeout</source>
-                               <note from="developer">This string contains an internal text, which must not be changed. Just copy the original text into the translation field. For more information have a look at the Tutorial.</note>
-                       </trans-unit>
                        <trans-unit id="cache_timeout.description">
                                <source>Sets the Cache Lifetime for the page.</source>
                        </trans-unit>
@@ -158,10 +146,6 @@ However you may need to disable caching for a page if it contains dynamic conten
                                <source>By default, pages are cached for 24 hours. After 24 hours, the page is constructed again and rewritten to the cache. Depending on your configuration, the cache may be cleared at midnight.
 When specific pages need a longer or shorter cache lifetime than the default, this option can be used.</source>
                        </trans-unit>
-                       <trans-unit id="_cache_timeout.seeAlso">
-                               <source>pages:no_cache</source>
-                               <note from="developer">This string contains an internal text, which must not be changed. Just copy the original text into the translation field. For more information have a look at the Tutorial.</note>
-                       </trans-unit>
                        <trans-unit id="no_search.description">
                                <source>If enabled, this option excludes the page from searching operations on the website.</source>
                        </trans-unit>
index 3de32ab..3a3608c 100644 (file)
@@ -51,7 +51,6 @@ class PagesVisibleFieldsTest extends \TYPO3\TestingFramework\Core\Functional\Fun
         'target',
         'cache_timeout',
         'cache_tags',
-        'no_cache',
         'l18n_cfg',
         'is_siteroot',
         'no_search',
@@ -83,7 +82,6 @@ class PagesVisibleFieldsTest extends \TYPO3\TestingFramework\Core\Functional\Fun
                 'content_from_pid',
                 'cache_timeout',
                 'cache_tags',
-                'no_cache',
                 'module',
             ],
         ],
@@ -98,7 +96,6 @@ class PagesVisibleFieldsTest extends \TYPO3\TestingFramework\Core\Functional\Fun
                 'content_from_pid',
                 'cache_timeout',
                 'cache_tags',
-                'no_cache',
                 'module',
             ],
         ],
@@ -112,7 +109,6 @@ class PagesVisibleFieldsTest extends \TYPO3\TestingFramework\Core\Functional\Fun
                 'content_from_pid',
                 'cache_timeout',
                 'cache_tags',
-                'no_cache',
                 'module',
             ],
         ],
@@ -136,13 +132,11 @@ class PagesVisibleFieldsTest extends \TYPO3\TestingFramework\Core\Functional\Fun
                 'content_from_pid',
                 'cache_timeout',
                 'cache_tags',
-                'no_cache',
                 'content_from_pid',
                 'alias',
                 'target',
                 'cache_timeout',
                 'cache_tags',
-                'no_cache',
                 'l18n_cfg',
                 'is_siteroot',
                 'no_search',
@@ -171,13 +165,11 @@ class PagesVisibleFieldsTest extends \TYPO3\TestingFramework\Core\Functional\Fun
                 'content_from_pid',
                 'cache_timeout',
                 'cache_tags',
-                'no_cache',
                 'content_from_pid',
                 'alias',
                 'target',
                 'cache_timeout',
                 'cache_tags',
-                'no_cache',
                 'l18n_cfg',
                 'is_siteroot',
                 'no_search',
@@ -203,13 +195,11 @@ class PagesVisibleFieldsTest extends \TYPO3\TestingFramework\Core\Functional\Fun
                 'content_from_pid',
                 'cache_timeout',
                 'cache_tags',
-                'no_cache',
                 'content_from_pid',
                 'alias',
                 'target',
                 'cache_timeout',
                 'cache_tags',
-                'no_cache',
                 'l18n_cfg',
                 'is_siteroot',
                 'no_search',
index 5c853ca..45373b0 100644 (file)
@@ -127,7 +127,6 @@ CREATE TABLE pages (
        endtime int(11) unsigned DEFAULT '0' NOT NULL,
        shortcut int(10) unsigned DEFAULT '0' NOT NULL,
        shortcut_mode int(10) unsigned DEFAULT '0' NOT NULL,
-       no_cache int(10) unsigned DEFAULT '0' NOT NULL,
        fe_group varchar(100) DEFAULT '0' NOT NULL,
        subtitle varchar(255) DEFAULT '' NOT NULL,
        layout int(11) unsigned DEFAULT '0' NOT NULL,
index edba1ff..3b04edf 100644 (file)
@@ -1369,10 +1369,6 @@ class TypoScriptFrontendController implements LoggerAwareInterface
             ];
             $this->pageNotFoundAndExit($pNotFoundMsg[$this->pageNotFound]);
         }
-        // Set no_cache if set
-        if ($this->page['no_cache']) {
-            $this->set_no_cache('no_cache is set in page properties');
-        }
         // Init SYS_LASTCHANGED
         $this->register['SYS_LASTCHANGED'] = (int)$this->page['tstamp'];
         if ($this->register['SYS_LASTCHANGED'] < (int)$this->page['SYS_LASTCHANGED']) {
index ab789f9..c5be983 100644 (file)
                        <trans-unit id="pages.tabs.behaviour">
                                <source>Behaviour</source>
                        </trans-unit>
-                       <trans-unit id="pages.no_cache">
-                               <source>No Cache:</source>
-                       </trans-unit>
-                       <trans-unit id="pages.no_cache_formlabel">
-                               <source>Cache</source>
-                       </trans-unit>
-                       <trans-unit id="pages.no_cache_checkbox_1_formlabel">
-                               <source>Disable</source>
-                       </trans-unit>
                        <trans-unit id="pages.no_search">
                                <source>No Search:</source>
                        </trans-unit>
index e585786..d5a84fe 100644 (file)
@@ -60,7 +60,6 @@ class PagesLanguageOverlayVisibleFieldsTest extends \TYPO3\TestingFramework\Core
                 'content_from_pid',
                 'cache_timeout',
                 'cache_tags',
-                'no_cache',
                 'module',
             ],
         ],
@@ -71,7 +70,6 @@ class PagesLanguageOverlayVisibleFieldsTest extends \TYPO3\TestingFramework\Core
                 'content_from_pid',
                 'cache_timeout',
                 'cache_tags',
-                'no_cache',
                 'module',
             ],
         ],
@@ -85,7 +83,6 @@ class PagesLanguageOverlayVisibleFieldsTest extends \TYPO3\TestingFramework\Core
                 'content_from_pid',
                 'cache_timeout',
                 'cache_tags',
-                'no_cache',
                 'module',
             ],
         ],
index 9e8dbe0..1fa66bf 100644 (file)
@@ -75,7 +75,6 @@ class PageInformationController extends \TYPO3\CMS\Backend\Module\AbstractFuncti
                     'uid',
                     'lastUpdated',
                     'newUntil',
-                    'no_cache',
                     'cache_timeout',
                     'php_tree_stop',
                     'TSconfig',