Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
BjoernG
Topic Author
Posts: 21
Joined: 31 Mar 2014, 02:32

Cache Problem

04 Apr 2016, 04:05

I have an issue with page-caching. I created new blog entries. They are shown in the "preview - mouse over" but when I go to the page, it shows only the older blog entries! Refresh the page helps sometimes... For testing, I disabled CloudFlare function (also purged all cached files there). I also cleared the cache on the web server (varnish cache).
Opened my website over different internet provider and also different browser (IE10 and chrome).
Any ideas?
ho, btw the link ;-): http://gosswiler.com/blog/
And detailed info attached in the pdf

KG Bjoern
Last edited by BjoernG on 08 Apr 2016, 01:57, edited 1 time in total.
Bjoern / gosswiler.com
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13999
Joined: 30 Sep 2006, 03:37

Re: Cache Problem

04 Apr 2016, 05:10

I am not sure how to diagnose this, but you won't get cached outputs served directly from X3 if something changed. I checked your page header output, and it includes these headers:
Code
Via: 1.1 varnish
X-Cacheable: YES
X-Varnish: 841631149
X-Cache: MISS
As you are already aware, you are using Varnish, and I would be surprised if it was not Varnish that cached your pages ... After all, that's what its for ... Varnish is really cool, but I don't see how your server is setup to automatically purge varnish cache when something changes in your X3. I would like to look into varnish-X3-compatibility myself one day.

I can only diagnose further if you provide panel access, but 99.99% sure it's varnish cache. It's not browser cache (browser doesnt generally cache page outputs unless instructed to do so from headers), and It's not Cloudflare either, because Cloudflare does not cache pages.
 
User avatar
BjoernG
Topic Author
Posts: 21
Joined: 31 Mar 2014, 02:32

Re: Cache Problem

07 Apr 2016, 07:42

Hi Karl

Thanks for your answer.
Mhh not sure what's going on, I disabled varnish and still get the same behavior.

During troubleshooting, I found out when I direct copy/paste the blog URL http://www.gosswiler.com/blog/
the page shows all blog entries. Only when I browse over the top menu I have to refresh the blog page to show all ten instead of eight entries.
Also strange, preview works fine...


Any suggestions

Bjoern
Bjoern / gosswiler.com
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13999
Joined: 30 Sep 2006, 03:37

Re: Cache Problem

07 Apr 2016, 10:01

Testing your headers today, I see you are using Cloudflare PAGE-CACHING, which explains everything:
Code
CF-Cache-Status: HIT
Server: cloudflare-nginx
CF-RAY: 28fdfc76a3db3096-SIN
I assume you setup this from the tutorial I posted? It was clearly mentioned that when using CF page-caching, although it makes your pages very fast, you will need to purge pages from the CF cache after updating them. Did you enter your Cloudflare credentials into the settings->panel, so that you get the Cloudflare purge cache options?

Im surprised that you have gone through the relatively technical and substantial (but worthwhile) process of setting up Cloudflare page-caching, yet you were not aware that cloudflare was then caching your pages.
 
User avatar
BjoernG
Topic Author
Posts: 21
Joined: 31 Mar 2014, 02:32

Re: Cache Problem

07 Apr 2016, 14:00

yes, I setup as you assumed in your post https://forum.photo.gallery/viewtopic.p ... 4&start=15.

I cleared the cache in the panel, and yes I set the cf credential in the panel.
Flushed the CloudFlare
I didn't help out.

But after a while thinking beside the cache, varnish, CloudFlare stuff, I thought about the "preload site object" setting.
before I disabled it, I recreate to objects over the menu, It didn't solve the problem.

At the end I disabling the feature and cleared again all kind of cache, and finally it looks like it works 8) .
Last edited by BjoernG on 08 Apr 2016, 01:58, edited 1 time in total.
Bjoern / gosswiler.com
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13999
Joined: 30 Sep 2006, 03:37

Re: Cache Problem

08 Apr 2016, 00:54

:) A multi-level cache setup like that may work very well, but it would require you to stay very conscious of all caching mechanisms when you want pages refreshed. X3 page-caching, X3 site Object, Apache varnish, Cloudflare, are basically all doing some form of cache, all layered on top of each other. The X3 page-cache is automated, as it will output new page if something changed ... The Site Object (if you are using preload feature), is NOT automatic, and you need to re-create it from panel after something changed. Then you have Varnish and Cloudflare, which will cache outputs of BOTH pages and the site object in front of X3 ....

You can pretty much be certain it was related to either Cloudflare or Varnish. I use Cloudflare, but I am not familiar with Varnish. Sounds like a labyrinth of caching though if you had both. Even if you cleared cloudflare, it would then pull a new page, and if that page was cached by varnish, cloudflare would have a new outdated page. Then if you refreshed your varnish, that would still mean cloudflare had an old page. You would literally need to purge caches simultaneously, in the right order ...
 
User avatar
BjoernG
Topic Author
Posts: 21
Joined: 31 Mar 2014, 02:32

Re: Cache Problem

08 Apr 2016, 02:01

:lol: good wording :mrgreen: I mean it's quite complex with more than two cache options...

thanks and happy weekend
Bjoern
Bjoern / gosswiler.com