How to prevent Load balancer returns old cached request

Manmath Kulkarni asked on September 13, 2017 10:19

Hi,

I am fetching attachment from Kentico. But "load balancer" before Kentico server returns old cached file instead of new update file. I am using following API to fetch file.

http://mySite.com/Site1/getattachment/textfile.txt.aspx

I have tried settings given here. https://docs.kentico.com/k10/configuring-kentico/optimizing-website-performance/configuring-caching/caching-page-output

Is there is any setting in Kentico that can prevent or am I missing something. Thanks in advance.

Best regards,
Manmath.

Recent Answers


Trevor Fayas answered on September 13, 2017 17:09

Have you set the Settings > System > Performance > Server File Caching > Cache Files (minutes)?

It has a minimum of 1 minute, but otherwise that may be what you want.

Also attachments aren't necessarily "Pages", they are more Files, see this article:

https://docs.kentico.com/k10/configuring-kentico/optimizing-website-performance/configuring-caching/caching-files-and-resources

0 votesVote for this answer Mark as a Correct answer

Manmath Kulkarni answered on September 13, 2017 17:33

Hi Trevor,

Thanks for your answer.
I have tried settings you have mentioned in the link but no use. There is load balancer before Kentico server that's caching the request.

Can this be solved by using "no-cache" header in master page or template? and if it's possible where to add this ?

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on September 13, 2017 17:39

Ah i follow you a bit more, i think you mean there is a CDN (Content Delivery Network)? Load balancer usually splits the traffic between two servers.

Then usually yes you will need something in the header to signify that the cache reset. Is there any live URL that i can see the response headers, or can you copy the response headers before changing and after changing the file?

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.