Regarding the clearCache() function, I would edit it that instead of clearing the entire site cache, it will only clear the com_jlexcomment folder.
That would definitely be better, yes
----------
But: even like this, if the com_jlexcomment cache is cleared when a comment is posted, then Caching Time will pretty much never be used. For example, say you put Cache Time to 3 hours. But you have a comment every 10 minutes. Cache Time will never be used... cache will always expire every 10 minutes.
Maybe a good solution would be to have 3 options for "
Cache Mode":
0: Disable (same as now)
1: Cache by time: This will use the "Cache Time" setting. The com_jlexcomment cache will only expire when the cache time limit is reached.
2: Clear on change: This will clear the com_jlexcomment folder cache when adding a new comment, changing state / featured, or deleting a comment.
So essentially, the clearCache() function should only be triggered if:
$config->get("cache") == 2
What do you think?
Regarding the language file, I hope you will send me the complete file or mark the lines that you fix, it will help me more.
I meant to say that you forgot to implement a language string for: "JCM_COMMENT_CACHE_TIME".
But yes, now that you remind me, we still have to do the update for the whole language files, I will update with a reply in the other forum thread.
@JLexArt is wrote at
2021-10-21 08:22:18
@Andy: I have added Caching Time as your suggestion. Regarding the clearCache() function, I would edit it that instead of clearing the entire site cache, it will only clear the [b]com_jlexcomment[/b] folder. It would be better than doing nothing when there is a comment with added.
Of course you can remove these lines of code to keep the cache.
Regarding the language file, I hope you will send me the complete file or [b]mark the lines that you fix[/b], it will help me more.
Best regards,
Victor Nguyen.