Open pr1sm opened 5 years ago
We should think about making a site specific mapping to negate requests to product endpoints that we know are blocked ahead of time. (e.g. – We know products.json is blocked on kith by default, so there is no need to make that request. This will help preserve the user's proxy as well before an eventual softban.
On hold until #361 is addressed
Is your feature request related to a problem? Please describe. Users will likely run multiple tasks to increase their odds of getting a successful checkout (jigging address, multiple sizes, using different proxies, etc.). This causes a large number of unnecessary requests to be made while monitoring for products, which increases the change of soft bans from occurring.
Describe the solution you'd like A cache of monitor requests should be created to reduce the number of duplicate requests made in the monitor. These include:
products.json
(kws/variants)collections.atom
(kws/variants)sitemap_products.xml
(kws/variants)<product_url>.json
(kws/variants/url)<product_url>.oembed
(kws/variants/url)This cache would have a timeout for hits equal to the monitor delay of a task. This would allow prevent multiple tasks from making the requests, but still keep the info relatively fresh (within one monitor delay)
The following diagram illustrates how the timing would work:
Describe alternatives you've considered Don't have any other alternatives at the moment, but will post any in the thread below
Additional context This will likely require a lot of refactoring to the
taskRunner
andmonitor
classes. Further, we would need some type oftask -> cache
communication. This will be easier if everything is in a shared address space (single/multi threaded vs multi process).Because of this, I'm putting this on hold until #192 is solved. This will allow us to phase out the multi process method if it is too difficult to keep that working.