MuchDev Posted October 23, 2015 Share Posted October 23, 2015 I am trying to brainstorm how I should handle this scenario. I use ProCache and currently have it set up to not show cached pages to all users with the wires_challenge cookie. This is working great but I have developed a front end user system which will be making all users possess the cookie. Now I have the need to selectively control what pages are cached and what pages are uncached at a group by group level. I thought I might post in procache, but this seems general enough that others may have some insight on how this could be implemented. Should I somehow save the pages that the user is able to view to the cookie and then check this against the page? As it stands now all new users will get uncached pages which is going to seriously slow down the site. One thing procache will do that may be helpful is that you will always see an uncached view if there is a get variable present. Maybe some way to check the user group and then redirect to the same page with a simple ?var=uncache Cached behavior: guests - view all cached frontend_user - view all cached except pages where they are permitted employees - view all uncached Link to comment Share on other sites More sharing options...
LostKobrakai Posted October 23, 2015 Share Posted October 23, 2015 If you can create a .htaccess rule, that can detect your users rights / levels, than you can use ProCache. Otherwise you'd need to look for an alternative caching solution. Link to comment Share on other sites More sharing options...
MuchDev Posted October 23, 2015 Author Share Posted October 23, 2015 That is a good point, I can't think of any way that one could do that programmatically. Where I am at right now is pretty much a hack with some code to detect whether the page has a permission that the user has. If the user has the permission then they will see an un-cached page by a redirect to the page with a get variable. This feels like it should work and will of course take some tweaking so that it doesn't inadvertently affect other pages. I am thinking that this is going to get quite complicated. Do you happen to have any suggestions for page caching that wouldn't be too terribly hard to implement with apache? Something that would possibly work better for this use case. Link to comment Share on other sites More sharing options...
LostKobrakai Posted October 23, 2015 Share Posted October 23, 2015 Where I am at right now is pretty much a hack with some code to detect whether the page has a permission that the user has. If the user has the permission then they will see an un-cached page by a redirect to the page with a get variable. This feels like it should work and will of course take some tweaking so that it doesn't inadvertently affect other pages. When will this be executed? ProCache skips any php occurrence in the request by directly going from .htaccess to the cached files. Link to comment Share on other sites More sharing options...
MuchDev Posted October 23, 2015 Author Share Posted October 23, 2015 Well it was my uneducated assumption that I might be able to make it work on the template level. Thank you for the quick response I guess I'll have to abandon that method then. I suppose that I could generate a cookie that had pages that would be viewed uncached and create a rewrite rule that checks against those values. It looks as if that is standard practice to use client side cookies for specific content (forgive me I don't work with cookies often). Link to comment Share on other sites More sharing options...
LostKobrakai Posted October 23, 2015 Share Posted October 23, 2015 You could always use another type of cache, instead of ProCache. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now