Joomla 3.5,缓存破解JavaScript包含联系表单插件

时间:2016-07-11 16:41:34

标签: caching joomla

因为,我相信,我管理的网站的3.5更新表现出一些奇怪的行为。其中一个问题是Custom Contact Form Plugin(此高级传感器分支是专门为该网站编写的)在包含它需要的一些JavaScript时遇到了问题。

如插件的基本文件中所示......

/**
 * Defer loading of JS until later in the execution cycle
 */
function onBeforeRender()
{
    $this->doc->addScript(JURI::base(true) . '/media/plg_customcontactform/js/form-actions.min.js');
}

启用“保守缓存”时(多年来一直如此),JavaScript文件仅包含在初始加载中。后续页面刷新不包括页面顶部资源列表中的文件。

在此处或Google搜索中未找到任何内容(也未在项目的问题列表中找到)后,我开始在代码中投掷谚语,但没有成功。该插件的创建者已经离开Joomla一段时间了,所以我想我会看到这里是否有人对Joomla的内部工作有更多的了解,并且可以帮助我解决这个问题。现在我禁用了缓存。谢谢!

1 个答案:

答案 0 :(得分:0)

I was having exactly the same problem, I'm using a RSForms Pro, and the forms are added to pages via modules. After pinpointing that the cause as was related to caching the solution was easy enough:
module manager > module > advanced > caching > no caching

You mention you're using a plugin so you have less control unfortunately.

One option could be a caching component or plugin like JotCache or CacheContol, both of which will give you greater control of what get's cached

Or if you have enabled
extensions > plugins > System - Page Cache
you can specify menu items or page urls which you don't want to be cached, this might work. These options are new, and are included with recent Joomla updates.

Good luck!