-
jartibise
Hi folks,
I’m at my wits end trying to troubleshoot this one.
I created a homepage hero where the client asked for rotating background photos. My initial solution was using some CSS and a PHP script to do so. It worked for me while I was logged in, but I soon found out that it wasn’t working for any logged out users.
Thinking it was my CSS or PHP that I messed up, I decided to go the route of creating a custom post type via ACF called ‘Home Hero Images’ and then using a Query Loop to bring in the data as a random post.
I have 6 posts under there, all with the same h1, h2, paragraph, link, etc. The only difference is the image that is used for the background.
I created the hero section and once again the posts rotate correctly while I’m logged in, however, they do not when I’m in an incognito window or logged out.
Troubleshooting I’ve tried:
-Coding vs creating a query loop/custom post
-Clearing cache via browser
-Clearing cache via plugins (Redis, Nginx, Autooptimize, ShortPixel)
-Clearing cache via hosting (Gridpane)
-Disabling all caching plugins
-Disabling every plugin (excluding GP)None of the above has worked.
The odd thing is that any time I edit a page via the editor, even if it’s just clicking the ‘Update’ button, the post/background image will change for a logged out user. But then it won’t load another one via refresh unless I hit ‘Update’ again.
So I’ve run out of ideas.
Any help?
-
Hi,
Can you provide the site link? Have you tried disabling all other plugins except GB and GPP?
-
jartibise
Sorry should’ve included link the first time.
It’s been included in the private information now.
Yes I disabled every plugin excluding GB and GPP.
-
The user is not an admin role, I can not see how you set it up.
Can you show me how you set this up?
-
jartibise
Sorry the account was an Admin… The account just wasn’t allowed to see the entire backend. I’ve changed that.
For simplicity, I also uploaded a video explaining the issue. Link in the private information. Hopefully that is easier to understand!
-
Alvind
Hi there,
Some hosting providers disable the random order query by default, which was my initial thought regarding your issue. Could you reach out to GridPane support and ask if they have any settings that could disable the random order query? While they are not a technically a ‘hosting provider’, it’s still worth confirming with them.
In the meantime, could you try installing the Query Monitor plugin to see if there are any hints about the random queries that have been running?
-
jartibise
I will reach out to them and see if there are any settings.
I’ve installed Query Monitor. Are there any settings I should be looking at changing?
-
Alvind
I’ve checked the database query log using Query Monitor, and everything seems to be working well. However, I believe I’ve found the issue.
When I viewed your site by bypassing the cache, the random background image worked correctly. Initially, I ruled out the cache issue because you mentioned earlier that you had already disabled all caches, yet the issue persisted.
You can see the difference by viewing your site with caching bypassed by adding
/?nocache
at the end of the URL. -
jartibise
You’re correct. Turns out that even with the plugins disabled, there was some server side caching through GridPane.
I’m trying to figure out if I can create some exclusions either via hooks or something else, to still have the hero and testimonials work with some Caching on now.
https://gridpane.com/kb/using-php-headers-to-create-custom-cache-exclusions/
-
Alvind
Great! It seems like it’s working now. I see a different hero image on each subsequent refresh.
- You must be logged in to reply to this topic.