Ok, I've done some extensive testing of the cache features, I analyzed the whole cache situation, and I changed my mind ona lot of things.
Like you, initially, I was thinking that the com_jlexcomment cache could be removed. But
at the end of my tests, I realized that the com_jlexcomment cache folder is actually useful and should stay.
Here are my conclusions and explanations:
Cache folders for JLex Comment:
mod_jlexcomment folder: When using the JLex Module, especially as "Dynamic Item", if you enable caching of the module, you will have a big problem: the comment form will be the same in all articles (it won't be dynamic item anymore). This is because the module is only cached once for all pages.
This means, that the JLex Module is really not eligible to be cached on its own. So, forget about adding "Cache Time" here
You should instead remove the "Caching" option completely for the Module under the "Module->Advanced" tab. The module should continue to just rely on the com_jlexcomment folder, and doesn't need its own folder.
-----
com_jlexcomment folder: It's true that when using the JLex Plugin, the com_jlexcomment cache folder should not be necessary, because the content of the comments is usually already cached by the respective component (eg. com_content cache).
So this initially lead me to believe that the com_jlexcomment cache folder could be removed.
However, when using the JLex Module,
the com_jlexcomment folder is useful because when using the module, comments are not cached by the respective component.
And as explained earlier, for this we cannot rely on the mod_jlexcomment folder (which can be removed).
The module has to keep relying on the com_jlexcomment folder (like it already is now), which indeed stores a cache for each separate object.
So for this reason, the com_jlexcomment folder should remain.
Also, the com_jlexcomment folder can be useful in another scenario: do all these components use Joomla cache?
https://www.jlexart.com/addons/jlex-comment+
I don't know. But
for the components that don't use Joomla cache, the comments will still be cached via the com_jlexcomment folder.
-----------------
Cache Time Setting for JLex Comment:
Now, regarding the "Cache Time". Adding a Cache Time to the module is now out of the question because it doesn't make sense to cache the module individually. So it should not be in the module. As mentioned, the whole "Caching" option should be removed from the module.
So, where to add "Cache Time"? Cache Time should be added in "JLex Comment->Settings->Advanced", under the "Cache Mode" setting.
It's true that like you said, the Cache Time will not apply when using the plugin because the plugin is already cached inside the cache of the respective component (eg. com_content)
However, the Cache Time will apply in these two scenarios:
- will apply for comment objects inserted via the JLex module (which have independent caching from component)
- will apply for plugins of components that don't use use cache.
So you could add the
Cache Time setting with this tooltip/description:
"Note: This Cache Time setting will not work when using a component that is already controlled by Joomla Cache Time (eg. com_content). However, it will work when using components that don't use Joomla Cache, and it will work when using the JLex Comment module"
-----------------
Renaming of the "Cache Mode" description:
Under the "JLex Comment->Settings->Advanced" area, I think the "Cache mode" description/tooltip should be renamed to make it more clear on how it works:
"When set to Yes, if the Joomla Cache is enabled, the comments form will be cached, and new comments will appear when the cache expires or is cleared. When set to Disable, the comments form will use an Ajax dynamic system that will make new comments always update in real-time."
-----------
I hope this analysis is useful