Handling users sessions properly & reducing TTFB

Hi all,

I have a joomla website which has long TTFB. I was able to sort out the issue. Here’s the post : TTFB differs when testing Joomla site with CDN - Joomla! Forum - community, help and support.

Am having issues in terms of how Joomla handles Front-end users after login. Examples :

  • a user will be redirected to wrong page after login
  • a user will see another username in login module (this other username comes from another logged in user at this moment)

The parameters at Cloudflare was :

Caching:

  • ‘Browser Cache Expiration’ to ‘Respect Existing Headers’

Rules :

  • Browser Integrity Check: On, Browser Cache TTL: an hour, Cache Level: Cache Everything, Edge Cache TTL: a month

To temporary sort out the issue, settings have been set to:
Caching:

  • ‘Browser Cache Expiration’ to ‘2 minutes

Rules :

  • Browser Integrity Check: On, Browser Cache TTL: an hour, Cache Level: Standard, Edge Cache TTL: a month

But with new setting am having very long TTFB again.

Anyone reading in have got some experience with handling joomla users when using Cloudflare to reduce TTFB ?

That tutorial doesn’t work if people are constantly logging into your site. Cache Everything does just that…cache everything, and the Edge Cache TTL puts the nail in the coffin on that one for logged in users.

The bottom line is that if someone is logged in, you can’t cache pages. With some trickery, you can cache-and-display pages for non-logged-in users. But that would require a Worker that bypasses cache for login cookies.

1 Like

Thanks, I will need to get to know how workers work. I’m not an experienced user on Cloudflare so will need to read a bit.

Yup, besides CF Worker based bypass cache on cookie, if you have Cloudflare Business plan or higher, you can implement it via bypass cache on cookie page rules - see https://blog.cloudflare.com/caching-anonymous-page-views/

Cloudflare can’t help with logged in user TTFB, that rest solely on your origin setup server config.

To fully optimise a site for performance and speed, you need to optimize 3 segments.

  1. segment 1 - connection between visitor and CF edge server i.e. CDN cache, WAF, Firewall, Page Rules, Mirage, Polish webP, HTTP/2, HTTP/3, CF Workers (i.e. custom/advanced caching) etc
  2. segment 2 - connection between CF edge server and your origin i.e. Argo, Railgun & Full SSL/ECDSA SSL certificates
  3. segment 3 - your origin server’s performance/optimisations i.e. web server, PHP, MySQL server optimisations and server hardware specs.

Cloudflare can only help for segments 1 & 2 for cached guest/non-logged based visitors. Now for Cloudflare CDN cache miss/bypass and logged in user for web apps like forums/wordpress/joomla performance is determined by segment 3.

So dynamic pages’ performance could purely be due to segment 3 factors related to your origin server itself i.e. web server, php and/or mysql database performance which need optimizing and/or better hosting.

1 Like

Many thanks, I can see clearer now.

Actually I’m quite satisfied with my site performance. My issue was about being penalized by Google for having a slow TTFB. So yes it’s about increasing performance for non logged-in users (such as google bots) only :wink:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.