Search
Other Articles Anywhere questions
Forum

Cloudflare HTML Cache & Articles Anywhere

Alex R's Avatar Alex R
Hi Peter!

I am having an issue with Cloudflare HTML Cache & Articles Anywhere working together (actually I am having the same issue when trying LiteSpeed Cache) On my article pages I use Articles Anywhere to call data like the author and some custom field values. Everything works great as long as I am not caching any pages, but as soon as I turn on cache it only works sporadically.

Can you give me some feedback on what might be causing this and possible solutions.

Thanks!

Alex
Peter van Westen's Avatar Peter van Westen ADMIN
It is probably due to the system plugin ordering. Try changing the ordering of the plugins in question.
See: regularlabs.com/blog/242-plugin-order-is-important
Please post a rating at the Joomla! Extensions Directory
Alex R's Avatar Alex R
I actually thought about that, but not sure if it matters since Cloudflare cache is external and I don't have any caching enabled on the Joomla site itself. I am checking it again though.
Peter van Westen's Avatar Peter van Westen ADMIN
What do you mean with 'it only works sporadically'? What doesn't work? Does it show the wrong data? Or do you see the original tags?
Please post a rating at the Joomla! Extensions Directory
Alex R's Avatar Alex R
What I mean is that sometimes it shows the data and sometimes not. And I just realized that it does always show the publishing date, but not the values from custom fields which I am using with if-else structures. The original tags are not an issue, it just returns blanks. Here is the code:
<p>{article-nested}</p>
<p class="author">{if source-author}Authored by <a href="[original-source-short-url:value]" target="_blank" rel="noopener">[source-author:value]</a>{/if}{if source-author = source-outlet-name || !source-author} via <a href="[original-source-short-url:value]" target="_blank" rel="noopener">[source-outlet-name:value]</a>{elseif source-author = source-outlet-name || source-outlet-name} via [source-outlet-name:value]{/if} [publish-up format="F jS Y"]</p>
<p>{/article-nested}</p>

Also here is an image on how it looks without Cloudflare cache enabled:


And here is an image on how it looks with Cloudflare cache enabled:


Confidential information:
(hidden)
Peter van Westen's Avatar Peter van Westen ADMIN
It looks like that for some reason, Articles Anywhere cannot see what the current article is when caching is on.
Does the code work when you place it inside the article itself? Instead of in a module?

PS: Why use {article-nested} instead of {article} ?
Please post a rating at the Joomla! Extensions Directory
Alex R's Avatar Alex R
Does the code work when you place it inside the article itself?
I will test it now.
PS: Why use {article-nested} instead of {article} ?
I am not sure, I am new to AA and If I remember correctly I wasn't able to get it to work with just article the way I wrote it with the if-else structures, but I'll try that as well again.
Alex R's Avatar Alex R
I just tried with the following article:

Confidential information:
(hidden)


And it now works both ways (module or direct in article). It is hard to troubleshoot because it is inconsistent. It almost looks like when I access the page first, it gets cached correctly, but if the cache gets initiated by another party somewhere else it can go wrong. What I am trying to say is, that it most likely has nothing to do with caching, but rather that the AA data renders differently based on another condition, for example, let's say I would have a rule in place not to show the data if someone is accessing it from Greece and if a person from Greece would be the first person to access the article, the article would obviously be cached without the AA data and as such would display it like that for all future visitors, but I cannot think of what might be causing it. Not sure if this makes sense to you?
Alex R's Avatar Alex R
And not to forget that it only happens to custom field values.
Peter van Westen's Avatar Peter van Westen ADMIN
Hard to tell what would cause it, if you can't really reproduce it.
See if there are other pages where the ifs would fail.

You can of course try to exclude the module from caching...
Please post a rating at the Joomla! Extensions Directory
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription