[TYPO3-ttnews] realurl/cache problem with tt_news single view

Bart Gijswijt bart.gijswijt at ahk.nl
Mon Jul 11 22:41:42 CEST 2011


Hi list,

We have been having some troubles with the tt_news single view in relation 
with realurl.

What happens is that after clearing the caches, the single view of tt_news 
items only works for items that are called up from a tt_news list. However, 
the single view does not work for items that for the first time are called 
up directly, i.e. via Google or by entering the url directly. In this case, 
a blank page is shown.

News items that were displayed correctly for the first time (because they 
were opened by clicking on the item in a news list) will be displayed 
correctly when opening them from Google or by entering the url afterwards.
News items that were not displayed correctly for the first time will never 
be displayed correctly afterwards, not even from a tt_news list (until 
clearing the cache).

In the table tx_realurl_uniqalias we can see that the problem (logically) 
occurs for items where there is no alias set yet. Somehow it seems that when 
calling up a news item for the first time through a tt_news list a unique 
alias is set, whereas when calling up an item for the first time from Google 
it is not set.
This is confirmed when we take a look at the GET variables in the Decode 
cache for our single view page (WEB > Info > Select single view page > 
RealUrl Management > Decode cache). For the items that are displayed 
correctly, we see (for example) ?id=3179&tx_ttnews[tt_news]=2131&cHash=...
For the items that are not displayed correctly, we see (for example) 
?id=3179&tx_ttnews[tt_news]=jolinde-de-lang-genomineerd-voor-art-olive-award

So instead of the tt_news id we see the RealUrl path - see attached 
screenshot of the decode cache for our main tt_news single page.

Below you can see our RealUrl setup. We are using Typo3 4.4.7, tt_news 3.0.1 
and RealUrl 1.11.2.
Internal caching for tt_news is disabled. We have tried to disable the page 
as well as the RealUrl cache for the news lists as well as the single view 
page.
We are assuming the problem occurs mostly for archived items; active items 
are often displayed correctly.

Any help is appreciated!
Best,
Bart Gijswijt
Amsterdam School of the Arts


<?php

$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array(
//--------------------------------------------

 'init' => array(
  'enableCHashCache' => true,
  'appendMissingSlash' => 'ifNotFile',
  'enableUrlDecodeCache' => true,
  'enableUrlEncodeCache' => true,
  'emptyUrlReturnValue' => true,
 ),
 'preVars' => array(
  array(
   'GETvar' => 'no_cache',
   'valueMap' => array(
    'no_cache' => 1,
   ),
   'noMatch' => 'bypass',
  ),
  array(
   'GETvar' => 'L',
   'valueMap' => array(
    'nl' => '0',
    'en' => '1',
   ),
   //'valueDefault' => 'nl',
   'noMatch' => 'bypass',
  ),
 ),
 'pagePath' => array(
  'firstHitPathCache'=> 0,
  'type' => 'user',
  'userFunc' => 
'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
  'spaceCharacter' => '-',
  'languageGetVar' => 'L',
  'expireDays' => 7,
  'rootpage_id' => 1112,
  'disablePathCache' => 1,
 ),
 'fixedPostVars' => array(
   //ahk nieuwsdetail 3179

  '3179' => array(
    array(
     'GETvar' => 'tx_ttnews[tt_news]',
     'lookUpTable' => array(
      'table' => 'tt_news',
      'id_field' => 'uid',
      'alias_field' => 'title',
      'addWhereClause' => ' AND NOT deleted',
      'useUniqueCache' => 1,
      'useUniqueCache_conf' => array(
      'strtolower' => 1,
      'spaceCharacter' => '-',
     ),
    ),
   ),
  ),


//----------------------------------------------

 'postVarSets' => array (
  '_DEFAULT' => array (
   'domein' => array (
    '0' => array (
     'GETvar' => 'hostname',
    ),
   ),
   // news articles and searchwords
   'titel' => array(
    array(
     'GETvar' => 'tx_ttnews[tt_news]',
     'lookUpTable' => array(
      'table' => 'tt_news',
      'id_field' => 'uid',
      'alias_field' => 'title',
      'addWhereClause' => ' AND NOT deleted',
      'useUniqueCache' => 1,
      'useUniqueCache_conf' => array(
       'strtolower' => 1,
       'spaceCharacter' => '-',
      ),
     ),
    ),
   ),

  'fileName' => array (
  'index' => array(
   'page.html' => array(
    'keyValues' => array (
     'type' => 1,
    )
   ),
   '_DEFAULT' => array(
    'keyValues' => array(
    )
   ),
  ),
 ),

 '_DOMAINS' => array(
  'encode' => array(
   array(
    'GETvar' => 'L',
    'value' => '0',
    'ifDifferentToCurrent'=> true,
    'useConfiguration' => '_DEFAULT',
    'urlPrepend' => 'http://www.ahk.nl'
   ),
   array(
    'GETvar' => 'L',
    'value' => '1',
    'ifDifferentToCurrent'=> true,
    'useConfiguration' => '_DEFAULT',
    'urlPrepend' => 'http://www.english.ahk.nl'
   )
  ),
  'decode' => array(
   'www.ahk.nl' => array(
    'GETvars' => array(
     'L' => '0',
    ),
    'useConfiguration' => '_DEFAULT'
   ),
   'www.english.ahk.nl' => array(
    'GETvars' => array(
     'L' => '1',
    ),
    'useConfiguration' => '_DEFAULT'
   )
  )
 ),



//----------------------------------------------
);

// multiple domain setup
// ahk.nl is the default, but specify default for best results


$TYPO3_CONF_VARS['EXTCONF']['realurl']['www.ahk.nl'] = 
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'];
$TYPO3_CONF_VARS['EXTCONF']['realurl']['www.ahk.nl']['pagePath']['rootpage_id'] 
= 868;
$TYPO3_CONF_VARS['EXTCONF']['realurl']['ahk.nl'] = 
$TYPO3_CONF_VARS['EXTCONF']['realurl']['www.ahk.nl'];


?> 


More information about the TYPO3-project-tt-news mailing list