Clear Varnish at the time of page activation in AEM
Hi Friends,
I have one situation to clear the varnish pages at the time of CQ5 page activation.
I am using the httpclient to purge the page in varnish . I am getting correct repsonse 200 Purged but that page is not getting cleared from the varnish.
Here is the code I am using, Please suggest the changes. Its very very urgent.
org.apache.http.HttpHost host = new HttpHost("IP");
HttpClient client = HttpClientBuilder.create().build();
BasicHttpRequest purgeRequest = new BasicHttpRequest("PURGE", "URL");
purgeRequest.setHeader("purgeKey","p0rg3m3!");
purgeRequest.setHeader("Cache-Control","no-cache");
HttpResponse response1= client.execute(host,purgeRequest);
Thanks In Advance :)