Tried to turn on caching for one of the most expensive query "tracker". I had data caching for 30 minutes and html for 0 sec.
What I noticed after this the pager disappears. The cache seems to be working.
At a purist level this is what it was supposed to since it cached only x results of data from query that is what you see.
From a users perspective that odd since I would expect atleast the pager should show and after going to next page it will cache that data since technically the query has different started at a different offset.
If we can get tracker view caching data, that would be a boon to many webmasters to reduce one of the expensive query.
Comment | File | Size | Author |
---|---|---|---|
#44 | views-6.x-3.x-dev-550962.patch | 552 bytes | Les Lim |
#9 | views_cached_pager.patch | 3.16 KB | igor.ro |
Comments
Comment #1
dawehnerCould you please export your tracker and post it here?
I tested it again, and it worked well.
Perhaps thats a problem with the bug in time based caching, did you tryed the dev version of views, or just the stable release?
Comment #2
ajayg CreditAttribution: ajayg commentedI used 2.6 stable with patch mentioned here #503774: Cache Time based does not reset
Here is my tracker view. It came default from OG
Comment #3
catchI'm also getting this - I'm caching the query results of the tracker, but not the output, so that #new links etc. still work per-user. I can't reproduce this if I cache both output and query, or neither.
Since pager_query() also populates all the globals for the actual pager etc., this makes sense, but means it'd need some special handling to fix it.
Comment #4
Phoenix2020 CreditAttribution: Phoenix2020 commentedI am also having this problem with my views:
- Caching "Query results" + "Rendered output": pager is there and working
- Caching none: pager is there and working
- Caching only "Query results": pager disappeares after the query results have been cached (after reloading the page).
Comment #5
eaton CreditAttribution: eaton commentedPlease note, too, that a number of subtle but annoying cache invalidation bugs have been fixed in the 2.7 release. Is there any way you can test this again using Views 2.7, rather than 2.6?
Comment #6
Phoenix2020 CreditAttribution: Phoenix2020 commentedI just made a test with Views 2.7 and the problem is still there. Exactly as described above:
1) Caching only "Query results"
2) Calling the view the first time (no cached queries): pager is there and working
3) Reloading the view / Calling it while queries are cached: pager disappears
Comment #7
ajayg CreditAttribution: ajayg commentedReconfirming the bug exists in View 2.7. If the query is cached, the pager disappears.
Comment #8
Phoenix2020 CreditAttribution: Phoenix2020 commentedAny news on this issue? A working solution to cache the query results would be really great.
Comment #9
igor.ro CreditAttribution: igor.ro commentedProblem was in synchronization views pager data with global pager variables.
Please test with several pagers on one page.
Patch attached.
Comment #10
igor.ro CreditAttribution: igor.ro commentedComment #11
Phoenix2020 CreditAttribution: Phoenix2020 commentedI just tested the patch from #9 and it works. The pager is NOT disappearing if the page is cached.
Comment #12
MJH CreditAttribution: MJH commentedThe Patch from igor.ro works perfectly in my case. The function to only cache the "Query results" is finally working with the pagers. Thanks
Comment #13
dawehnerThats the wrong status :)
Comment #14
izmeez CreditAttribution: izmeez commentedsubscribing
Comment #15
ajayg CreditAttribution: ajayg commentedI confirm the patch above fixes the issue I reported. Tested with views 2.8
Comment #16
merlinofchaos CreditAttribution: merlinofchaos commentedBecause the patch moves a chunk of code and teh change appears to be in this chunk, I can't easily tell what was changed within this chunk.
Also, Views 3 handles pagers differently, so in order to commit this i'll need a patch that works against both 2.x and 3.x
Comment #17
ajayg CreditAttribution: ajayg commented@merlinofchaos
the patch is to move the chunk of code but there is no change in that chunk of code itself. That chunk of code is now a function call which is now called from two places (instead of previous only one place). The chunk itself has not changed.
Comment #18
merlinofchaos CreditAttribution: merlinofchaos commentedStill need patch against 3 before I can commit to 2.
Comment #19
chawl CreditAttribution: chawl commentedsubs
Comment #20
ajayg CreditAttribution: ajayg commentedAnybody familiar with views 3.x, can you please look at the patch in #9 and create one for views 3.x so both can be commited? This would be a quite good performance improvement.
Comment #21
seanrThis definitely still happens, and it's even more specific than the bug reported above - both caches have to be set to the exact same time limit in order for the pager to appear consistently.
Comment #22
izmeez CreditAttribution: izmeez commentedsubscribing
Comment #23
secretuser CreditAttribution: secretuser commentedThe problem is still here with version 6x-2.11
Comment #24
crea CreditAttribution: crea commentedsubscribing
Comment #25
dawehnerSeveral questions to merlinofchaos here
Comment #26
yched CreditAttribution: yched commentedand the last question remained unspoken :-)
Comment #27
dawehnerOh this was just a non-closed tag. Ignore it.
Comment #28
ronnbot CreditAttribution: ronnbot commentedAlso have been experiencing the same issue. Haven't tried the patch, but we've been using a work around by implementing the hook 'hook_preprocess_views_view' to add the pager back to the view when needed. Ironically it does so by caching the pager when it exists.
Comment #29
dawehnerQuestion to everyone:
Do you use caching of the views?
Comment #30
ajayg CreditAttribution: ajayg commentedYes I use. I use different cache settings for different views. It reduces load considerbably for some of my views that don't need to be refreshed immediately.
Comment #31
dawehnerI think there was a issue about problems with pagers and caches
Comment #32
ajayg CreditAttribution: ajayg commentedThe issues is there if you want to just cache query but not HTML. If you cache both then there is no issue. A great usecase where this is required is "tracker" type pages. You want to cache query but to preserve new comments links you don't want to cache html.
Comment #33
Vacilando CreditAttribution: Vacilando commentedSubscribing.
Comment #34
catch@dereine, this is the issue. However the patch needs work rather than active since it's just a porting issue.
Comment #35
dawehneroh i just have to many issues. I will work on a solution and search the other issue
Comment #36
catchPatch in http://drupal.org/node/550962#comment-2353282 for 6.x-2.x
Comment #37
kika CreditAttribution: kika commentedConfirming the problem on both views 2.11 and latest 3.x and that the patch on #9 works for me.
Comment #38
voxpelli CreditAttribution: voxpelli commentedAccording to #18 this patch needs a version for Views 6.x-3.x prior to being committed. Therefor the status for this is "needs work" and nothing else. The fact that it works for Views 6.x-2.x doesn't change that status.
I also want to point out that this is related to #636128: Don't have the cache rely on $_GET which in turn is dependent on #635990: Make the cache respect db_rewrite_sql() and substitutions.
Comment #39
wojtha CreditAttribution: wojtha commentedSubscribing.
Comment #40
Aurochs CreditAttribution: Aurochs commentedThat patch did not help me with Views 6.x-2.11, installed that by hand.
Comment #41
Aurochs CreditAttribution: Aurochs commentedUpgraded to 3.x and that solved the problem but now i have to fix tons of pager issues and some other cause i need to change seetings almost for all views.
Comment #42
srjoshSubscribing; I've also seen in some cases where setting both causes the pager to break, but it's inconsistent.
Comment #43
catchThe pager works when you get a cache miss, it's on cache hits where it doesn't get initialized.
Comment #44
Les LimThe fix for 6.x-3.x-dev should hopefully be much simpler. Patch attached, which works in limited testing.
Comment #45
mstrelan CreditAttribution: mstrelan commentedsubscribe
Comment #46
podarok#44 works good for 6.x-3.0-alpha3 too (with line shift)
so RTBC
also tested with #1089034: True views cache for a multiple blocks with multiple pagers
Comment #47
merlinofchaos CreditAttribution: merlinofchaos commentedCommitted to all branches.
Comment #49
Vacilando CreditAttribution: Vacilando commentedDoes 6.x-2.x-dev contain the solution as well?
Comment #50
Les LimNope, still needs action for 6.x-2.x. There's a patch that needs to be re-reviewed in #9 above.
Comment #51
Les LimWhoops, never mind. Here's the commit message:
https://drupal.org/commitlog/commit/1174/6ce5bb11927ac8824667f7497008446...