XF 2.1 Approval queue improvements, Admin options UI tweaks, Guest page caching and more!

Welcome to the fifth in our "Have you seen...?" series for XF 2.1. In case you've not yet seen the previous entries, (why not?!) you can check them out here.

As ever, to ensure you're kept up to date, we strongly recommend giving that "Watch forum" link a tap and make sure you enable email notifications if you haven't done so already 🙂
 

Nicolas FR

Well-known member
I did not understand anything about these novelties !

The only thing I understood is that XF 2.1 is released saturday afternoon !! Right ? :p
 

ibnesayeed

Well-known member
Reduced session usage for guests

We already provide a caching layer which, if configured, allows you to offload sessions out of the database. In the case of guests, which most likely accounts for the majority of your online users at any given time, session reads and writes (regardless of where they're stored) presents a fairly significant overhead. To reduce this overhead, we've implemented some changes in XF 2.1 which reduces the need to interact with sessions for guests.

First and foremost, we will no longer write a session at all if the session has no data. For that to work, we need to make sure we're not unnecessarily storing data in the session in the first place.

One such area which we decided to take out of the session is the indicator we use to know whether or not any given guest user was referred to the site via a search engine. Rather than storing this in the session data, we now store this in a cookie.

Also stored in the session was a record of the result of the last time we checked that user to see if their IP address had been banned or discouraged. As this is generally very quick to calculate, we've decided to not cache this at all going forward which most likely has an overall net benefit in that we no longer need to read/write this.

Ultimately, with these tweaks in place, most guests will rarely need a session record at all which mostly eliminates a database/cache write on many pages.

Alternatively, you could have used JSON Web Tokens (JWT) just for guests or for all users instead of server-side session store. These tokens can be tamper-proof if the server generates a random secret at the time of initialization for signing tokens. It is a very well-supported and well-adopted RFC already.
 

rdn

Well-known member
the advertising content supports XF template syntax any way.
Hmm yeah :D

You may use XenForo template syntax here.


But the same feature already exist on Widget System:
1540324257617.png
 

eva2000

Well-known member
Guest page caching is enabled via the config.php file and uses a distinct cache "context" to avoid issues that may occur if you put page cache data into the same bucket as sessions. By default, most pages will be cached, though this can be opted-out as necessary in PHP code. However, advanced users can control what routes are cached via prefix or a regular expression. By default, pages are cached for 5 minutes to balance speed against recency, though this can be changed. (Very advanced users will have access to configure some of the page cache options programmatically.)
Would advanced cache configurations have any option to just offload guest caching logic to the web server itself ?

For example, when guest caching is enabled add a special cookie to distinctly detect guest vs logged in and/or maybe even tag specific routes with specific cookies which we can programatically configure at web server level to include or exclude from caching ?

i.e. for nginx PHP-FPM fastcgi_cache https://xenforo.com/community/resou...x-fastcgi_cache-full-page-guest-caching.5393/ and similarly for Nginx proxy_cache you can set cache to include or exclude requests based on detected cookies.

The same can be done for other cache accelerators like Varnish Cache and LiteSpeed Cache Addon for utilising a special cookie(s) to determine what can/cannot be cached. So such an optional advanced option would be useful for folks wanting XF 2.1 to offload full page guest caching from PHP to the upstream web server or web accelerator itself :)

Such a cookie(s) feature would also work with Cloudflare Business level plans and higher for bypass cache on cookie page rules outlined at https://blog.cloudflare.com/caching-anonymous-page-views/ so you can offload full page guest caching to Cloudflare too! So larger Xenforo clients who don't want to mess with web server level cache configurations can just use Cloudflare Business level plans to configure page rules for bypass cache on cookie settings and enable XF 2.1 advanced cache cookie(s) route setups. Cloudflare Enterprise plans can even go one better with Cloudflare Custom Cache Keys to cache on cookie detection.

By adding advanced XF 2.1 full page guest caching routes by cookie(s) you will single handily allow alot of upstream PHP offloading methods for much better performance via

  • Nginx proxy_cache
  • Nginx + PHP-FPM Fastcgi_cache
  • Varnish Cache
  • LiteSpeed Cache
  • Cloudflare Business and higher plan guest caching

I ask as XF 2.1 guest cache seems to still require requests to pass through PHP itself and that reduces the efficiency and performance of full page guest caching - I've seen it first hand with other web apps (wordpress/magento) that implement full page guest caching through PHP having only slightly better performance than without full page guest cache as opposed to when compared to doing full page guest caching where load is moved from PHP to the web server or web accelerator.
 
Last edited:

Slavik

XenForo moderator
Staff member
Would advanced cache configurations have any option to just offload guest caching logic to the web server itself ?

Currently no. Though obviously this new addition means creating an addon to do so is quite a bit simpler now, or would make for a great suggestion if it can be added to the core to leverage the web server level caches.
 

Jake B.

Well-known member
Redesigned approval queue

The approval queue can be a fairly daunting place. It contains a lot of information all laid out in a long column with the relevant actions being at the bottom. We've redesigned how this information is displayed in XF 2.1 and overall still kept the important information. For developers, the template code to create an approval queue item is simpler too.

This is what the approval queue looks like now:

View attachment 186070

There is now a greater focus on the content itself that needs to be reviewed, with the actions being listed over on the right.

To make navigating through the queue easier, we've now added a new filter bar.

View attachment 186071

As well as being able to filter the list by content type, it is also possible to sort the queue in descending order so that you can view the most recently created entries first, if you wish.

How does this play with existing add-ons that add things to the approval queue? I assume they'll work still but just look off?
 

Andy.N

Well-known member
Widget display conditions

If you have ever had to display a widget, but only conditionally based on user group or some other criteria, then you'll know that this isn't exactly straightforward. The current approach actually requires you to create the desired widget without assigning it to a position, and then create a HTML widget to add your conditions manually and call the widget you want.

One of the things many people have told us they like from our Navigation feature is the ability to use template syntax-like conditions so it made a lot of sense to bring that feature to widgets too.

If you have a widget that you only want to display to a specific user group then it's as simple as adding something like this to the new "Display conditions" field:

View attachment 186076
I'm not sure if this is planned, already available, etc but can you please confirm if there is an option to order the display order of the widgets? It would be extremely useful to be able to do that.
 

Martok

Well-known member
I just read XF2.1 is released Saturday!? Is this true!?
I don't believe that a XenForo release has ever been on a Saturday seeing as it's a weekend. I can tell you when it will be released though:

When it's ready™
 

Slavik

XenForo moderator
Staff member
I don't believe that a XenForo release has ever been on a Saturday seeing as it's a weekend. I can tell you when it will be released though:

When it's ready™

Every major release has been done early in the working week to allow a quick response to any immediate issues or bugs that may have slipped past testing.
 

ŽivaAkcija

Well-known member
again same story from same people, and same question about release, 1.5. 2.0 and 2.1, and 90% of them even not run installed 2.0!

happy new year, when is ready!
 

S Thomas

Well-known member
Great work, unless I've already missed it, is there any option to do bulk actions for the approval queue? I have almost 16000 entries in mine and it's unfeasible to go through each one - doing bulk actions would save a lot of time and I can clear that queue out much better.
Has this been answered?
 

Chris D

XenForo developer
Staff member
I think if you've let your approval queue get that out of hand (which isn't at all the designed use case) then regardless of what we implement you're going to struggle.

Even if there was a "Select All" you'd still need to do it page by page which at 50 per page is over 300 pages.

If it's full of users, you can use Batch update users to sort those out, at least.
 
Top