TYPO3-如何禁用页面上特定内容元素的缓存? [英] TYPO3 - Howto disable cache for specific content element on a page?

查看:109
本文介绍了TYPO3-如何禁用页面上特定内容元素的缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以禁用页面上一个特定元素的缓存?如此答案所述,我已经尝试过以下打字稿,但对我来说不起作用(TYPO3 v8):

Is it possible to disable the caching for one specific element on pages? I tried already the following typoscript, as described in this answer, but it is not working for me (TYPO3 v8):

tt_content.textmedia.20 = USER_INT

我正在将ext:fluid_styled_content与自定义CType一起使用.根据我的理解,上述打字稿应禁用对内容元素"Text& Media"的缓存(仅作为示例).

I am using ext:fluid_styled_content with custom CTypes. From my understanding the above typoscript should disable the caching for the content element "Text & Media" (just as an example).

我的自定义元素使用ViewHelper从API读取实时数据.但是,当不缓存元素时,将仅调用ViewHelper.否则将显示缓存的内容.

My custom element reads live data from an API using a ViewHelper. But the ViewHelper is just called, when the element is not cached. Othervise the cached content will be shown.

推荐答案

fluid_styled_content使用FLUIDTEMPLATE内容对象,而不是使用css_styled_content中的USER. FLUIDTEMPLATE没有非缓存"变体.我相信有一些选项可以更改该元素的缓存,但是我在文档中找不到任何内容.

fluid_styled_content uses the FLUIDTEMPLATE content object instead of USER as it was in css_styled_content. FLUIDTEMPLATE has no "non-cached" variant. I believe there are some options to change the caching of that element, but I could not find anything on that in the documentation.

或者,您可以将其包装在一个COA_INT对象中,该对象看起来像这样:

Alternatively you could wrap it in a COA_INT object, which would look like something like this:

tmp.textmedia < tt_content.textmedia
tt_content.textmedia >
tt_content.textmedia = COA_INT
tt_content.textmedia {
    10 < tmp.textmedia
    10 =< lib.contentElement
}

如果您在打字对象浏览器(模板模块)中查看,则更改前的外观应如下所示:

If you take a look in the typoscript object browser (Template module), before the change it should look something like this:

更改后,它应如下所示:

And after the change it should look like this:

这篇关于TYPO3-如何禁用页面上特定内容元素的缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆