Developer forum

Forum » Development » Automating Campaign Removal and Cache Clearing

Automating Campaign Removal and Cache Clearing

Johanne Glimsdal
Johanne Glimsdal
Reply

Hi,

We're currently using a scheduled SQL task to remove campaigns from products once they're over, and it's working well.
The issue we're facing is with caching: the products keep showing the campaign info until we manually clear the cache.

Is there a way to automate both the campaign removal and cache clearing at the same time?

Any advice or solutions would be greatly appreciated.

Thanks!

 


Replies

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply
This post has been marked as an answer

Hi Johanne,

 

Assuming you're creating a custom Add-In to trigger the SQL query on a schedule task, you can call the following method to clear all product cache.

Dynamicweb.Ecommerce.Common.Application.KillProducts();

 

Best Regards,

Nuno Aguiar 

Votes for this answer: 1
 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

You should not use that call as it is deprecated.

Use Productservice.ClearCache() - aka Dynamicweb.Ecommercer.Services.Products.ClearCache()

Votes for this answer: 1

 

You must be logged in to post in the forum