Importing 3rd party content: How to clear cache of a specific resource programatically?

So I have a system set up that synchronizes data from another system with the employee biography content on our website. The total number of biographies on the site is around 500 pages, not including pages for services, news and other resources.

This process is otherwise working very well, but in some cases certain TVs are changed but not displaying on all the biographies properly until the entire site cache is cleared. Since this importer runs multiple times throughout the day, coding a mass cache clear every time is not reasonable IMO.

I’m thinking that if I can find a way to clear individual resources; that when this importer runs, we can determine which resources were updated in the time between imports, single them out by taking the editedon dates from the period between imports and clearing just those items.

I’ve looked at the docs and cannot find out how to do this by resource. I know that when you save a cached resource, the system resets that resource’s cache anyway. I just want to do this with the imported data too.

Thank you

Hi @jeffsydor , how about that?


I agree with antar’s suggestion. The other day I used importx to load ~50 resources. They did not show up in the various queries (pdoresouces, pdoAtoZ, etc). I opened one and saved the resource, That triggered a clearing of the appropriate parts of the cache. Then all the new resources appeared in the various queries.