{"action":"created","issue":{"url":"https://api.github.com/repos/ryancramerdesign/ProcessWire/issues/974","labels_url":"https://api.github.com/repos/ryancramerdesign/ProcessWire/issues/974/labels{/name}","comments_url":"https://api.github.com/repos/ryancramerdesign/ProcessWire/issues/974/comments","events_url":"https://api.github.com/repos/ryancramerdesign/ProcessWire/issues/974/events","html_url":"https://github.com/ryancramerdesign/ProcessWire/pull/974","id":59401620,"number":974,"title":"Add support for clearing cache for pages matching custom selector","user":{"login":"teppokoivula","id":1252021,"avatar_url":"https://avatars.githubusercontent.com/u/1252021?v=3","gravatar_id":"","url":"https://api.github.com/users/teppokoivula","html_url":"https://github.com/teppokoivula","followers_url":"https://api.github.com/users/teppokoivula/followers","following_url":"https://api.github.com/users/teppokoivula/following{/other_user}","gists_url":"https://api.github.com/users/teppokoivula/gists{/gist_id}","starred_url":"https://api.github.com/users/teppokoivula/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teppokoivula/subscriptions","organizations_url":"https://api.github.com/users/teppokoivula/orgs","repos_url":"https://api.github.com/users/teppokoivula/repos","events_url":"https://api.github.com/users/teppokoivula/events{/privacy}","received_events_url":"https://api.github.com/users/teppokoivula/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-01T15:55:38Z","updated_at":"2015-03-25T18:23:33Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ryancramerdesign/ProcessWire/pulls/974","html_url":"https://github.com/ryancramerdesign/ProcessWire/pull/974","diff_url":"https://github.com/ryancramerdesign/ProcessWire/pull/974.diff","patch_url":"https://github.com/ryancramerdesign/ProcessWire/pull/974.patch"},"body":"[This recent forum post](https://processwire.com/talk/topic/8997-clear-cache-for-all-children/) got me thinking that it would be nice if page cache could be cleared for pages matching a selector. While definitely not as effective (in regards to time and resources spent clearing cache files) as clearing cache for entire site, it would allow really fine-grained workflow when necessary.\r\n\r\nWhat do you think, does this make any sense at all? Better implementation could probably boost both performance and flexibility, if only the concept is sensible.\r\n\r\nFor the record, I'm already using this on my blog to clear specific page cache files when tags or blog posts are altered. Only other viable option would be clearing cache for entire site every time :)"},"comment":{"url":"https://api.github.com/repos/ryancramerdesign/ProcessWire/issues/comments/86158702","html_url":"https://github.com/ryancramerdesign/ProcessWire/pull/974#issuecomment-86158702","issue_url":"https://api.github.com/repos/ryancramerdesign/ProcessWire/issues/974","id":86158702,"user":{"login":"ryancramerdesign","id":328272,"avatar_url":"https://avatars.githubusercontent.com/u/328272?v=3","gravatar_id":"","url":"https://api.github.com/users/ryancramerdesign","html_url":"https://github.com/ryancramerdesign","followers_url":"https://api.github.com/users/ryancramerdesign/followers","following_url":"https://api.github.com/users/ryancramerdesign/following{/other_user}","gists_url":"https://api.github.com/users/ryancramerdesign/gists{/gist_id}","starred_url":"https://api.github.com/users/ryancramerdesign/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryancramerdesign/subscriptions","organizations_url":"https://api.github.com/users/ryancramerdesign/orgs","repos_url":"https://api.github.com/users/ryancramerdesign/repos","events_url":"https://api.github.com/users/ryancramerdesign/events{/privacy}","received_events_url":"https://api.github.com/users/ryancramerdesign/received_events","type":"User","site_admin":false},"created_at":"2015-03-25T18:23:33Z","updated_at":"2015-03-25T18:23:33Z","body":"This seems like a good use case for InputfieldSelector? I've been looking at adding something similar to ProCache too (with InputfieldSelector). I think the only concern here is that it could only scale so far. If the selector specified matches hundreds or thousands of pages, that's going to be a very expensive operation every time the page is saved, and worst case, won't be able to complete. It's a useful feature for sure. But making it scale seems like it would have to go into some kind of processing queue to be executed over multiple requests. Maybe in the short term, we just automatically add a \"limit=200\" to it, or something like that, to prevent the potential for a fail. \r\n\r\nYou'd think it would be the same issue with the \"expire entire site\" one except that it's actually the most efficient variation possible. It just adds a timestamp file, which anything that pulls from the cache checks first. So it doesn't have to do any page-by-page deletions, or even touch any cache files to expire it for the whole site. \r\n\r\nI'll think a little more here too to see if I can come up with any more ideas, or let me know if you think of any. "}}