It would be great if there were options for each block to

1) bypass the drupal page cache for the block
2) bypass or modify the max age for reverse proxy caches for the block.

In my case the returned block contents really need to be up to the minute, but Varnish & Drupal are caching the output.

I have hacked my away around this by adding this to block_refresh_block_content :

// Tell varnish to hold data for 2 minutes
  // and drupal NOT TO CACHE at all.
  drupal_add_http_header('Cache-Control', 'public, max-age=120');
  $GLOBALS['conf']['cache'] = FALSE;

But for general use this should be configurable.

cheers

Phil

Comments

tripper54’s picture

Assigned: Unassigned » tripper54
Issue summary: View changes

  • Commit ccefcb1 on 7.x-2.x by tripper54:
    Issue #2083013 by tripper54: Add options to bypass cache
    
tripper54’s picture

Status: Active » Fixed

Added to 7.x-2.x branch

  • Commit ccefcb1 on 7.x-2.x, 8.x-1.x by tripper54:
    Issue #2083013 by tripper54: Add options to bypass cache
    

Status: Fixed » Closed (fixed)

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