/// <summary>
 /// This only clears the cache on the application server, not the web server.
 /// This means that the web panels will still be visible in the UI, until
 /// a /default.aspx?flush is requested.
 /// </summary>
 /// <param name="cacheName"></param>
 public void ClearCache(string cacheName = null)
 {
     using (var diagAgent = new DiagnosticsAgent())
     {
         diagAgent.FlushCachesByName(new string[] { "ExtAppCache" });
     }
 }
        private void ProvideFeedbackToTheUser()
        {
            // Go to user's installation:
            var url = SuperOfficeAuthHelper.Context.GetUsersInstallationUrl();

            using (var agent = new DiagnosticsAgent())
                agent.FlushCaches();


            using (ConfigurationAgent ca = new ConfigurationAgent())
            {
                ca.ClearConfigurationCache("WebClient", "Web", true);
            }



            if (!url.IsNullOrEmpty())
            {
                // flush the CRM.WEB caches:
                url += "/default.aspx?flush";
                Response.Redirect(url);
            }

            // shouldn't happen, but just in case:
            var labels = _repeater.FindDescendants <Label>();

            var label = labels.First(lb => lb.ID == "_installFeedback");

            if (label != null)
            {
                label.Visible = true;
                label.Text    = "The app has been installed, please go to your online installation to try it out!";
            }
        }