Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 26 Jul 2020, 18:23
X-or X-or is offline
 
Join Date: Nov 2005
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?

Last edited by X-or; 26 Jul 2020 at 18:52.
Reply With Quote
  #2  
Old 27 Jul 2020, 19:46
z3r0's Avatar
z3r0 z3r0 is offline
 
Join Date: Apr 2005
Location: Lancashire, UK
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

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
Better VB.org search
Reply With Quote
  #3  
Old 29 Jul 2020, 08:30
X-or X-or is offline
 
Join Date: Nov 2005
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

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
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 29 Jul 2020, 09:22
z3r0's Avatar
z3r0 z3r0 is offline
 
Join Date: Apr 2005
Location: Lancashire, UK
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.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
Better VB.org search
Reply With Quote
  #5  
Old 29 Jul 2020, 14:15
X-or X-or is offline
 
Join Date: Nov 2005
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.

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.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
Thank, I will give it a try as soon as I know how to verify if it works.
Reply With Quote
  #6  
Old 30 Jul 2020, 07:09
z3r0's Avatar
z3r0 z3r0 is offline
 
Join Date: Apr 2005
Location: Lancashire, UK
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.
__________________
Better VB.org search
Reply With Quote
  #7  
Old 31 Jul 2020, 11:21
X-or X-or is offline
 
Join Date: Nov 2005
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
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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


New To Site? Need Help?

All times are GMT. The time now is 08:24.

Layout Options | Width: Wide Color: