Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-26-2020, 03:23 PM
X-or X-or is offline
 
Join Date: Nov 2005
Posts: 201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default exclude groups from no-cache http headers ?

there is a vb option which causes me a lot of problems
Add No-Cache HTTP Headers (default No)

the above option saves a lot of queries but also cause problems to users who constantly have to refresh pages manually

can't we have something in between and excludes groups like unregistered from these No-Cache headers?
Reply With Quote
  #2  
Old 07-27-2020, 04:46 PM
z3r0's Avatar
z3r0 z3r0 is offline
 
Join Date: Apr 2005
Posts: 339
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've not got any time to do any testing, but couldn't you just turn the no-cache option on and off per usergroup in a plugin?

So to disable for guests:-
hook location - global start
Code:
if ($vbulletin->userinfo['userid'] == 0) {
$vbulletin->options['nocacheheaders'] = 0;
}
Reply With Quote
  #3  
Old 07-29-2020, 05:30 AM
X-or X-or is offline
 
Join Date: Nov 2005
Posts: 201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by z3r0 View Post
I've not got any time to do any testing, but couldn't you just turn the no-cache option on and off per usergroup in a plugin?

So to disable for guests:-
hook location - global start
Code:
if ($vbulletin->userinfo['userid'] == 0) {
$vbulletin->options['nocacheheaders'] = 0;
}
Thanks for your help.

How can I test if it works though?

And is there a way to expand to multiple usergroups (to disable nocache for low activity groups as well), I know the syntax in templates, but plugins appear to use a different syntax.
Reply With Quote
  #4  
Old 07-29-2020, 06:22 AM
z3r0's Avatar
z3r0 z3r0 is offline
 
Join Date: Apr 2005
Posts: 339
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just examine the headers sent by the page.

I always need to lookup the plugin syntax, after a quick search it looks like this is what you need for multiple groups.

Code:
if (is_member_of($vbulletin->userinfo, x,y))
Reply With Quote
  #5  
Old 07-29-2020, 11:15 AM
X-or X-or is offline
 
Join Date: Nov 2005
Posts: 201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by z3r0 View Post
Just examine the headers sent by the page.
Sorry if this sounds stupid but I don't know anything about that, what should I look for that would prove the page is cached or not cached.

Quote:
Originally Posted by z3r0 View Post
I always need to lookup the plugin syntax, after a quick search it looks like this is what you need for multiple groups.

Code:
if (is_member_of($vbulletin->userinfo, x,y))
Thank, I will give it a try as soon as I know how to verify if it works.
Reply With Quote
  #6  
Old 07-30-2020, 04:09 AM
z3r0's Avatar
z3r0 z3r0 is offline
 
Join Date: Apr 2005
Posts: 339
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Most browsers have developer tools in their menu's, open the developer tools and check the element headers on the network tab (there is loads of info on google on how to do it)

I've had a quick look this morning and the code from my first post does seem to work, the pragma header switches between no-cache and private the same as it does when changing the global no-cache setting.
Reply With Quote
Благодарность от:
X-or
  #7  
Old 07-31-2020, 08:21 AM
X-or X-or is offline
 
Join Date: Nov 2005
Posts: 201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks z3r0, so far it seems to work wonders.
I highly recommend this plugin to anyone who had to enable no-cache headers. This will keep cache enabled for inactive users without disturbing active members. A must have.
Reply With Quote
Благодарность от:
z3r0
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:59 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04380 seconds
  • Memory Usage 2,227KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (2)post_thanks_box_bit
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete