Jump to content

Recommended Posts

Posted (edited)

See the large spike in activity compared to normal, any ideas how I can cope with that now guest page cache has been removed? It's adding more pressure onto the server as expected during this sort of moment to the point where it crashes and maxes out (this is a powerful server too)

Could contain: Line Chart, Chart

Edited by marklcfc
Posted (edited)

Instead of going the cloudflare route, you could look at using a local caching solution such as nginx.  However you’re going to have to write you caching rules yourself. That would give you precise control over settings but it’s more work.

Personally I would just enable base page caching in CF and lock guests to a default theme. Otherwise you’re just making more work for yourself. 

Edited by Randy Calvert
Posted (edited)

You can change it in clouudflare if you must. But, unless you have a specific reason to not have it set to that, other than thinking it's too long, perhaps just try it and see how it goes. In our experience it's been fine and no user has complained.

Edited by Dll
Posted

It sounds like you asking for the impossible. You want a cache to save you under high load, but you also don’t want to set the cache to cache times, where it could actually significantly reduce the load. If you can’t compromise on the cache, you probably have to rethink your server setup and move to a setup with load balancing options. A one-server setup, powerful or not, will have its limits. 

Posted
7 minutes ago, Dll said:

You can change it in clouudflare if you must. But, unless you have a specific reason to not have it set to that, other than thinking it's too long, perhaps just try it and see how it goes. In our experience it's been fine and no user has complained.

I tried it but my site was always 10-15 minutes behind for guests, during a busy time I have a live topic that is constantly updating - if the guests are 10-15 minutes behind its a big problem and makes the site almost pointless to visit.

 

Posted (edited)

Then as has been mentioned above, perhaps it's time for you to upgrade to load balanced servers. 

Personally though, I'd recommend testing it with the caching switched on for a period of time and see how your users find it. Ultimately, it's a forum not a chat room and so people tend to read more than just the very latest posts.

Edited by Dll
Posted (edited)
6 minutes ago, Dll said:

Then as has been mentioned above, perhaps it's time for you to upgrade to load balanced servers. 

Personally though, I'd recommend testing it with the caching switched on for a period of time and see how your users find it. Ultimately, it's a forum not a chat room and so people tend to read more than just the very latest posts.

I tried it and it was no good, during that busy time of 30 minutes to an hour, 99.9% of visitors will be viewing the one topic where the latest posts need to be available. It worked with guest page caching set as 30 seconds even those it was advised against, it helped the server cope compared to now without it.

Whats a load balanced server?

Edited by marklcfc
Posted (edited)
12 minutes ago, marklcfc said:

Whats a load balanced server?

It’s having multiple servers with a “traffic cop” that sits in front and directs traffic between the two instances.  

Edited by Randy Calvert
Posted (edited)
17 minutes ago, Randy Calvert said:

It’s having multiple servers with a “traffic cop” that sits in front and directs traffic between the two instances.  

Sounds like it'd be expensive, not something I need to solve spikes that happen 5/6 times a year at most

Edited by marklcfc
Posted
18 minutes ago, teraßyte said:

Since you mentioned a live topic, can't you simply add a rule to exclude that specific topic/url and still cache everything else for guests?

It could be an option but don't fancy doing that each time, plus in general I wouldn't want my site to be 10-15 minutes behind for guests even during normal periods.

Posted (edited)
51 minutes ago, marklcfc said:

It could be an option but don't fancy doing that each time, plus in general I wouldn't want my site to be 10-15 minutes behind for guests even during normal periods.

Think you're going to need to compromise somewhere. Either by spending more with either more server power/load balancing or with cloudflare so you can change the cache time to something more acceptable for you.

Or, you're going to have to accept the default cache time or the fact your site is going to crash when it's busy.

Alternatively I suppose you could wait for Leicester to get relegated at the end of the season, then I imagine those busy times may get less frequent 😅

Edited by Dll
  • 2 weeks later...
  • 2 weeks later...
Posted

Sorry @marklcfc I missed your post. I had to disable the guest cache on my main sites because I have more than 1 theme available, but am using it on others. I had to refresh my memory but yes I agree, the cache value is a constant, meaning it shouldn't change by design and overides any existing previous value.

As they mentioned, IPS sets it (in the .init file) as 900 secs/15 mins, so having this line in the constants.php file acts as an overide. The issue we had, was that that this overide line was there but we didn't know about it and it was set to 0, so nothing was being cached by Cloudflare even though we had set up the suggested Rules (we also had them set to respect the origin's TTL setting and not overide it but remember it was 0 for some reason). After removing it completely it would have the effect of letting IPS' init 900 seconds prevail.

So you can indeed set the constant to cache for just 30 seconds if you prefer and Cloudflare allow it that low, personally I think there's no harm in at least a couple of minutes, it would take up to a further 3x-4x the max page load off your server and people sort of know a forum isn't a live instant chat per se. If guests sign in they get to see the latest posts instantly and you get new members. Its win/win.

I know though 15 mins might be too long for a live footie match discussion site, but as the others said, you have to accept a compromise, switch to Chatbox or similar, or get it working with revalidation/stale content headers.

I noticed that CF have added a section to the Caching Rules where you can optionally overide TTL based on status codes received from the origin server, which could be useful.

 

Posted

I just noticed this part of the CF Rule was causing me problems:

Could contain: Page, Text

If you are logged in as an Admin and then log out, and are not logged in as a Member, you won't get the cached page becasue the IPSSessionAdmin cookie is still in the browser.

I deleted the cookie via browser tools and immediately the page cache was working for me.

Posted (edited)
1 hour ago, The Old Man said:

I just noticed this part of the CF Rule was causing me problems:

Could contain: Page, Text

If you are logged in as an Admin and then log out, and are not logged in as a Member, you won't get the cached page becasue the IPSSessionAdmin cookie is still in the browser.

I deleted the cookie via browser tools and immediately the page cache was working for me.

Does it work fine without that line then? Why was it added in any case as surely ips4_member_id does the same thing?

I think I'll just use it in extreme circumstances to take the load off the server if I need to. So I'll just keep it as it is (without that admin session id) with 30 seconds set in the constants file

Edited by marklcfc
Posted

Hint: The only one who is going to have an IPSSessionAdmin cookie are users accessing ACP.  (It was not even set until I logged into ACP.)  That should hopefully only be about 1% or less. of people accessing your site.  

That rule will impact people who were logged into ACP, but then logged out of the site afterwards.  Also... you can be logged out of the front end of the site without being logged out of the ACP

Posted

There are two logins, so I believe that’s why there are 2 session cookies. You can be logged into just the AdminCP without being logged into the front end as a Member, or be logged into both.

From what I’ve read in the past, session cookies where originally supposed to last just the duration of a session, but a few years back the Google devs decided to retain them after the session ends so that you could reopen existing tabs/sessions (a new feature). I’ve seen bug reports for Chrome and Firefox covering this and hence they were marked as intentional.

I think there is a browser setting at least in Firefox, on whether to enable or disable this feature I’ll have another look tomorrow.

I think this is something just to bear in mind if you are testing a page caching setup, it only effects Admins, but it explains why after I re-enabled the guest page caching that I was seeing dynamic despite the cache control header also being present.

2 hours ago, marklcfc said:

So I'll just keep it as it is (without that admin session id) with 30 seconds set in the constants file

Yeah, probably easier than using a Transform Rule but that works too. I use one for the non-IPS parts of a site with 1000’s of pages.

Posted

Anytime you test as a guest, I would recommend opening up an incognito/private browser session or using a browser on your computer specifically for that. There will always be related data in your browser, whether that is cache, cookies, local storage, etc... that you will want to have cleared to get a real sense of what a guest is seeing. Just my 2 cents 🙂 .

  • 3 weeks later...
Posted

hello, 

I ran my forum at gtmetrics (saw some do that here) and it brings this result. 

how can I find out if it is related to cloudflare which i am using? 

Could contain: Page, Text, File

 

In general, besides above question, I am seeking for support 

because my serveradmin does not have the time to look after that, and I need to  give him directions on how to change if there is a change needed...   

How do I assess the situation and if I need to make improvements , and who can do these for me ?

 

 

 

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...