Comments

mikeytown2’s picture

StatusFileSize
new839 bytes

current hard-coded way to not count nodes in a view block.

mikeytown2’s picture

Status:Active» Needs work
sillygwailo’s picture

Attached is a patch for configuring which views get excluded from {boost_cache_relationships} in admin/settings/performance/boost (against DRUPAL-6--1-18). Is that sort of what you were going for?

mikeytown2’s picture

Looking at the code, looks like its the right idea. Nice find with views_get_all_views(). I'll have in incorporate that into the code elsewhere.

I would like to do this one more level of granularity; being able to select which displays get used in the view. The original patch excludes all block displays which is surprisingly effective. Something along this with blocks excluded as the default sounds like the correct way to go about this.

Thanks for the patch BTW. I'll play with it in a couple of days.

sillygwailo’s picture

The attached patch allows the administrator to configure individual displays for exclusion from {boost_cache_relationships}. Maybe the form could use some work, including a button that selects all displays in a view?

Again, this patch applies to DRUPAL-6--1--18.

mikeytown2’s picture

prototype code. Show views that have a path, can be cached by boost & anonymous users can access

<?php
 
echo timer_read('page');
 
$account = user_load(0);
 
$views = views_get_all_views();
 
$list = array();
  foreach (
$views as $key => $view) {
   
// disabled views get nothing.
   
if (!empty($view->disabled)) {
      unset(
$views[$key]);
      continue;
    }

   
$view->init_display();
    foreach (
$view->display as $display_id => $display) {
     
// Make sure view has a path
      // Anonymous users can access view
     
if (isset($display->display_options['path']) && $view->access($display_id, $account)) {
       
// Path is cacheable via boost & does not take arguments
       
if (boost_is_cacheable($display->display_options['path']) && !stristr($display->display_options['path'], '%')) {
         
$list[$key][$display_id] = array(
           
'enabled' => TRUE,
           
'path' => $display->display_options['path'],
          );
        }
       
// Path is not cacheable via boost
       
else {
         
$list[$key][$display_id] = array(
           
'enabled' => FALSE,
           
'path' => $display->display_options['path'],
          );
        }
      }
    }
  }
  echo
'<br>' . timer_read('page');
  echo
str_replace('    ', '&nbsp;&nbsp;&nbsp;&nbsp;', nl2br(htmlentities(print_r($list, TRUE))));
?>
mikeytown2’s picture

Game plan:
Use the above code as the default set of views that will get searched. If the view takes an argument in the path, it will not be run when searching for the new/changed node in a view. In the long run I need to save the arguments the view takes otherwise bad things (performance wise) happen to your taxonomy/term/% view. Another idea is to search the boost_cache for the list of arguments in use; this won't have 100% coverage of new things though.

When new views get added; operate one of two ways:
A.) run it through the default code
B.) disable until admin has enabled it

List of views takes about a second to generate for me; thus I will save the views & ID's to use in the variables table. If option A is selected then it will update the list on cron. If option B then it only gets updated when the admin saves a new one.

mikeytown2’s picture

Status:Needs work» Needs review
StatusFileSize
new12.61 KB

very untested patch; mainly been working on the UI.

mikeytown2’s picture

StatusFileSize
new21.32 KB

this patch has been tested more

mikeytown2’s picture

Solving the taxonomy/term/% view issue is really only an issue if your using an external cache like varnish & your using the expire module. I would need to save all tids that I get from boost_expire_node() in a global so it will be available in the _boost_view_insert() shutdown function. Once there I pass the tid as an argument into the view; if I get a match, I then run that path taxonomy/term/5 through the url function to get the alias. I can then pass that along as a path that needs to be expired.

mikeytown2’s picture

StatusFileSize
new25.22 KB

Right now I'm making the assumption that your taxonomy term pages are filtered based off of domain access. This happens in the boost_expire_node function. If you ignore domain access for taxonomy/term then boost will not function correctly with the latest changes; it will not expire the correct taxonomy terms.

Quick hack is to load up the taxonomy/term/% view and see if it contains a domain access filter.
Complicated stuff...
Attached is the latest changes to the patch.

mikeytown2’s picture

StatusFileSize
new27.13 KB

Includes the quick hack

mikeytown2’s picture

StatusFileSize
new27.33 KB

I think its safe to assume that if the node shows up on a view without the domain access filters, it will appear on all domains. Modified patch to take this into account.

mikeytown2’s picture

Status:Needs review» Fixed

committed.

martinjbaker’s picture

After updating to 28 Aug dev version, I'm now getting

Fatal error: Call to undefined function domain_domains() in /home/showbuzz/public_html/sites/all/modules/boost/boost.module on line 954

when visiting certain pages as authenticated user. Am not using domain access module.

mikeytown2’s picture

StatusFileSize
new1.47 KB

opps.
here's the patch to fix that; its been committed.
http://drupalcode.org/viewvc/drupal/contributions/modules/boost/boost.mo...

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

goldlilys’s picture

Can you please reupload the boost with the patch you created and link it here. The link on #16 is giving me a 404 page not found error.

Need this badly because mysql file size is growing too much that it takes forever to back it up.

ndstate’s picture

Status:Closed (fixed)» Active

Can anyone verify which one of these patches will help with the table size?