Find Cache file Path
Question asked by Chirag Gawde - March 28 at 12:14 AM
Locked
Unanswered
Hi I am using the DocumentUltimate and want to get the cache folder name. which is created when a document is loaded.
Example : ~ App_Data\DocumentCache\~krcth

I need to find ~krcth folder name. I have used
var cache = DocumentUltimateWebConfiguration.Current.GetCache();
string folder=cache.LocationId;
But it returns the same value every time and there is no folder for the same value. Is there any way i can get the newly created cache folder name ?



Whole Code is down Below, I am trying to delete cache of a user when it exceed 2 as multiple caches are slowing down the response.
                 DataTable docache = new DataTable();
                    if(Session["docache"] == null)
                    {   
                    docache.Columns.Add("Path");
                    docache.Columns.Add("Time");
                    docache.Columns.Add("Number");
                    }
                    else
                    {
                        docache = (DataTable)Session["docache"];
                    }
                    var cache = DocumentUltimateWebConfiguration.Current.GetCache();
                    string path =cache.LocationId;
                    int cachecount = Convert.ToInt32(hfcache.Value.ToString());
                    cachecount++;
                    docache.Rows.Add(path, DateTime.Now.ToString("ddMMyyyyhhmmss"), cachecount);
                    hfcache.Value = Convert.ToString(cachecount);
                    if(docache.Rows.Count >2)
                    {
                        string deletecachepath=Server.MapPath("~/App_Data/DocumentCache/" +                         docache.Rows[0]["Path"].ToString());
                        DeleteDirectory(deletecachepath);
                        docache.Rows[0].Delete();
                    }
                    Session["docache"] = docache;
                    //End