Views has a setting for 'Disable views data caching' which can prevent Views data being cached.

I propose adding a similar setting that allows for any caching plugins to be disabled (for use when testing or developing locally, for example).

Original bug report:
Setting 'Disable views data caching' on admin/structure/views/settings/advanced doesn't actually disable Views caching because views_plugin_cache uses cache_get() instead of the wrapped views_cache_get() (which checks the views_skip_cache variable).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

justanothermark’s picture

Patch to fix. Note: bug was found & this tested with views_plugin_cache_time.

Had to add an $expire parameter to views_cache_set so that we didn't lose any existing behaviour.

Also added $bin parameter to cache_get/set for completeness in wrapping cache_set but would be happy for that change to be taken out if it's preferable to put everything from views_cache_set into the 'cache_views' bin.

Defaults provided for both parameters so that all existing code will continue to work as it always did.

justanothermark’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 1: views-cache-disable-2202131-1.patch, failed testing.

The last submitted patch, 1: views-cache-disable-2202131-1.patch, failed testing.

justanothermark’s picture

Status: Needs work » Needs review
FileSize
3.88 KB

Missed the $use_language parameter form views_cache_set() calls.

justanothermark’s picture

Title: 'Disable views data caching' not working » Add option to disable caching in Views.
Category: Bug report » Feature request
Issue summary: View changes
FileSize
1.42 KB

After offline discussions I have realised that the 'Disable views data caching' is for the data Views uses for processing & not the results of Views queries.

Therefore, I have updated the issue & patch to a feature request of a new setting to prevent any cache plugin from caching data or output. The patch works by adding a setting to the advanced settings page and checking this before Views loads the caching plugin on a view (in the same way that the live preview avoids caching).

renatog’s picture

Category: Feature request » Support request

Hi how are you

Ths idea is perfect. But in VIews for D7 the Team using for only fixes and new features are in Drupal 8.

I recommend that you create your project for DO.

renatog’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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