Post

4 followers Follow
1
Avatar

Is there a way to get all item IDs in the user's last view?

Does anybody know if there's a way to get all item_ids or app_item_ids in the user's last view for an app?

Currently, the best I've come up with, is getting the view's filters and passing them to filter_items and looping through the results. This takes a lot of time for tens of thousands of items.

Timo Sillander

Please sign in to leave a comment.

9 comments

1
Avatar

Thanks!

That saves me some code but it's still slooooooow.
Takes about 20s to load just 200 items.

I can get around the slowness with caching in just about every other situation but this; there's no way (that I can think of) to cache or retrieve current user's last view's items for a given app. All I need is the IDs, everything else is already cached.

Timo Sillander 1 vote
1
Avatar

Can you share a request id from the HTTP response headers so I can investigate?

Andreas Garnæs 1 vote
1
Avatar

I can see that the response contains a massive amount of data. You can consider adding the query parameter fields=items.view(micro) to exclude of lot of information in the response and see if that helps.

Andreas Garnæs 1 vote
1
Avatar

Whoa, quite a difference: that cut about 96% from our test query's execution time! Thank you very much!

I take it that PodioItem::filter_by_view does not have this option?

Timo Sillander 1 vote