CaelanStewart Posted June 22, 2015 Share Posted June 22, 2015 Hi, We have a client, who's website has grown quite large now. With a custom blog implementation, various resources sections, 434+ users registered (via a custom, designed registration UI that allows only company/associate employees to register. There is an accompanying mobile app for it, I have written an API so that the app and ProcessWire can communicate. What I need to do is check if any sub-pages within parent page (with no limit to depth) have been edited with the least processing possible, and the only way I can think of right now is to iterate through the pages, and check every lastEdited date against a set cached dates stored by the app. We just want to reduce the amount of processing required by the apps requests. Link to comment Share on other sites More sharing options...
Wanze Posted June 22, 2015 Share Posted June 22, 2015 Hi, If you have a lot of pages, I'd go with a direct SQL query. The query would be something like this: SELECT id FROM pages INNER JOIN pages_parents ON (pages_parents.pages_id = pages.id AND pages_parents.parents_id = 'YOUR_PARENT_ID') WHERE pages.modified > 'YOUR_MODIFIED_DATE' Cheers Link to comment Share on other sites More sharing options...
CaelanStewart Posted June 22, 2015 Author Share Posted June 22, 2015 Hi, If you have a lot of pages, I'd go with a direct SQL query. The query would be something like this: SELECT id FROM pages INNER JOIN pages_parents ON (pages_parents.pages_id = pages.id AND pages_parents.parents_id = 'YOUR_PARENT_ID') WHERE pages.modified > 'YOUR_MODIFIED_DATE' Cheers Hi, Half an hour after I posted this I came up with a similar solution, except using ProcessWire's Selector API. It's quick enough, and we've throttled the app to only check for new content every couple of hours. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now