[TYPO3-mvc] Caching problem with start page content rendered through an Extbase Extension

Helmut Hummel helmut.hummel at typo3.org
Wed Apr 30 01:40:38 CEST 2014


Hi Nicolas,

On 27.04.14 22:37, Nicolas Owassapian wrote:

> At the moment I'm using this "start-page-plugin" to render the start-page
> (e.g. for main category 1: called through the domain-name without any GET
> param) as well as to render the output for every other given/selected
> category (through typolink generated links with GET param for category and
> cHashes).

This scenario sounds reasonable.

> Would it be the right way to use one action for the start-page (output for
> default category 1) and another action (second plugin on a different page)
> to render the output for the other categories?
>
> With this setup the start page would always render the same output and
> therefore can be cached.
> Correct?

Well this would of course also work. If you use different pages for 
different output you do not have any issues the the page based cache 
strategy of TYPO3.

 > gives me the two possibilities
 >
 > 1) Throw a 404 - Page Not Found error
 > 2) Disable the cache
 >
 > As both of them are not real solutions for my application

This I don't understand.

You propose the following:

page1 (root/home): plugin with default action: categoryOneAction
page2: plugin with default action: anotherCategoryAction

This would result URLs like this if you use realurl:

Home:  /
Page2: /page/path/page2/

If you mistype the URL to page2, e.g. /page/pat/page2/ you'll get a 404 
error


Now let's use the cHash and put the plugin on the homepage:

page1 (root/home):
==================
plugin with default action: categoryOneAction
same plugin has another action: anotherCategoryAction
which can be triggered with the parameter tx_plugin[action]=anotherCategory

If you generate links with a cHash the content is correctly cached 
twice. One version with, and another version without cHash and action 
parameter.

When you now configure tx_plugin[action] as required cHash parameter, 
and use realurl you get links like this:

Home (default):      /
Home (other action): /category/category-title/

The cHash is cached by realurl.

Now if you mistype this URL: /catego/category-title/

You get a 404 when pageNotFoundOnCHashError=1 (default in 6.2)

So this is pretty much the same as your solution with a different page.


Either way works, you can choose what makes more sense for your usecase...

Kind regards,
Helmut

-- 
Helmut Hummel
Release Manager TYPO3 6.0
TYPO3 Core Developer, TYPO3 Security Team Member

TYPO3 .... inspiring people to share!
Get involved: typo3.org


More information about the TYPO3-project-typo3v4mvc mailing list