If you create a view that is something like "All nodes where source domain = current domain" then views caching becomes useless. The reason being that the first time the view gets run "current domain" might be example1.com and the results will get cached as such. If the next time that view gets run "current domain" is example2.com the user will get incorrect results.

This patch (and the attached inc file which should be unzipped into the domain_views/includes folder) is a views plugin that acts exactly the same way as the default views time-based caching but it does so on an individual domain basis.

I think this should be incorporated into domain_views...

Comments

agentrickard’s picture

Status: Needs review » Needs work

Interesting. Some minor typos in the help text. Needs inline comments in the .inc file.

bleen’s picture

Status: Needs work » Needs review
StatusFileSize
new1.2 KB
new1.39 KB

how bout this

agentrickard’s picture

StatusFileSize
new4.28 KB

Nice. Seems like it should work.

Here's a properly formatted patch against 6--2 that should apply to 6.x.2.4. Apply from /domain root.

Testers?

agentrickard’s picture

There are some spots where this code can be optimized, but I'm not sure I care too much.

agentrickard’s picture

Status: Needs review » Fixed

Committed to 6--2. And Domain Views HEAD.

Nice patch!

bleen’s picture

Awesome ... thx!

agentrickard’s picture

For the record, I did test this briefly, and it works as advertised. Nice little feature.

Status: Fixed » Closed (fixed)

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

michelle’s picture

Oh thank goodness for this. I just did moved some things around that I probably shouldn't have done without testing on a dev site first and discovered I made a mess with the caching. Didn't even know about this little gem. This will work nicely. :)

Thanks for saving me from my own carelessness. :)

Michelle