My program reads publications from internet and each time have to read one, first check if there is a cached copy on the device and if not, read it from internet. In the directory structure I have a folder named "data" corresponding to the inner layer of the Clean Architecture. Here I have all related classes about read from Internet and cache.
My question is, where to put the logic about select the correct data source of my entity (cache o internet). It belongs to a case of use (for example, GetPublicactionInteractor) or I should put in the data layer?
I think, as with most things, the answer is going to be quite subjective and the right answer will depend on your exact scenario and what makes most sense to you.
Personally, I'd keep the data source selection logic out of the data layer itself and, using the same terminology as the Clean Architecture, I'd put it in the "Use Cases" layer.
As per Uncle Bob's article:
The software in this layer contains application specific business rules
I'd class your requirement as an application specific rule, although I'm sure many others would disagree.