Download & Extend

Caching views until node is posted/updated - Cache Module Idea

Project:Views content cache
Version:6.x-1.x-dev
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Hello all,

I'm currently in need of a views cache module which flushes the cache of a specific view as soon as a node of a certain content type was created or updated. I thought this would be a very obvious requirement, but haven't found any way to do this except for writing some custom caching code. My question: Is there any way to do this? If not, would anybody be interesting in using such a module if I would develop one?

Dave

Comments

#1

I don't think thats such specific stuff should be included into views.

You could sure develop it for your own

a) Write a caching plugin, which adds a specific key to the cache_key
b) use hook_nodeapi to remove the caches with this specific cache_key prefix

#2

Status:active» fixed

Such a module would likely be valuable in the contrib space, I think, because it seems to be something that would be commonly wanted. If you are willing to maintain a module, I highly recommend you create the plugin and create a module for it.

#3

Thank you for your feedback. What about this? Any objections against writing to the settings table on nodeapi insert/delete? And any other suggestions on what could be included?

AttachmentSizeStatusTest resultOperations
views_advanced_cache.zip4.62 KBIgnored: Check issue status.NoneNone

#4

I would have used cache_clear_all and use a specific cid to remove from the cache table.

#5

Is there any special reason for that? I was trying to use the expire function inherited from the original cache plugin object so that my plugin would be as similar as possible to the "reference implementation" that comes with views. Plus I can put in some more settings into my cache plugin and combine multiple cache strategies (as soon as I or someone else thinks of more use cases).

Another question that came to mind: When using the time based caching that comes with views, will one view version be cached for all users, or will it be cached per role or even per user?

Thanks

Dave

#6

new

Is there any special reason for that? I was trying to use the expire function inherited from the original cache plugin object so that my plugin would be as similar as possible to the "reference implementation" that comes with views. Plus I can put in some more settings into my cache plugin and combine multiple cache strategies (as soon as I or someone else thinks of more use cases).

You have less data in your tables :)

#7

Very interesting...subscribe.

#8

Project:Views» Views content cache
Version:6.x-2.9» 6.x-1.x-dev
Status:fixed» active

#9

Status:active» fixed

@huesforalice let me know if you'd like commit access to the module, or feel free to file patches.

This is now working quite nicely, mad!

#10

Hi Steven,
I was planning to release this as an own small module sometime soon. Or is there any other way of integrating it into views in a sensible manner? If I do release it, then I'd need svn access.
Dave

#11

Ah, I've already released the code as the project that this issue is now attached to.

I note that you don't have CVS access, feel free to post patches and I'll commit them until you get a CVS account.

#12

Ah ok very nice. I was looking forward to releasing my own first module though. Well never mind, I'll see if I can get svn access and then I'll get back to you.

#13

Thank you! Thank you thank you thank you.... this is *exactly* what I was looking for and has done some very nice things for a freelance project I'm working on for a friend. Thank you for tackling this problem. :)

#14

Status:fixed» closed (fixed)

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

nobody click here