- Issue created by @darvanen
- 🇦🇺Australia darvanen Sydney, Australia
Oh would you look at that, Subqueries can now be added to query conditions → .
Thinking out loud here because I'm not somewhere I can actually try this today, and maybe someone has another idea.
The way the first plugin works is to add an expression to the view query to make certain the chosen field is part of the response and easy to access, then it sorts the provided values, takes the nearest one and uses that as the cache lifetime.
The reason for sorting outside the query is the view may already have an ORDER BY clause and removing or editing conditions from queries is very complex and would be prone to break in my opinion.
The problem with an archive view is that the content which will affect the lifetime of the cache isn't in the returned results. If reversing the polarity of the condition/s for showing entities was possible it would be a reasonably short job to apply the same processing and come up with a value, but I don't think that can be done.
Instead, I think I'll try to use the view query as a NOT IN subquery so I get all of the content that isn't in the returned set. All I have to figure out then is how to build the wrapper query so that it links properly.
Active
1.0
Code
Oh would you look at that, Subqueries can now be added to query conditions → .