---
title: "FileCache Class"
canonical: https://www.graphicsmill.com/docs/gmwc/T_Aurigma_GraphicsMill_AjaxControls_FileCache.htm
archived: true
applies_to:
  - product: "Graphics Mill Web Controls"
---

**You’re viewing documentation for an outdated product.** Graphics Mill Web Controls is no longer part of Graphics Mill. For current design editing and rendering tools, see [Design Atoms .NET](https://customerscanvas.com/docs/on-premises/design-atoms-cs/), [Design Atoms JS](https://customerscanvas.com/docs/on-premises/design-atoms-js/), and [Design Editor](https://customerscanvas.com/docs/on-premises/design-editor/).

# FileCache Class

**Applies to:** Graphics Mill Web Controls · **Archived documentation**
 
This class manages the private and public file cache used by the [BitmapViewer](https://www.graphicsmill.com/docs/gmwc/T_Aurigma_GraphicsMill_AjaxControls_BitmapViewer.htm.md).
 
**Namespace:** [Aurigma.GraphicsMill.AjaxControls](https://www.graphicsmill.com/docs/gmwc/N_Aurigma_GraphicsMill_AjaxControls.htm.md)
 **Assembly:** Aurigma.GraphicsMill.AjaxControls (in Aurigma.GraphicsMill.AjaxControls.dll)
 
## Syntax
  
```csharp
public class FileCache : IFileCache
```
 
## Remarks
  
This class is used if you need to store your own files in the Graphics Mill cache (e.g. if you add some extra functionality to the web control). Using this class you can generate unique filenames and get both physical and virtual paths to these files. The Graphics Mill cache will take care about these files lifetime, etc.
 
The workflow for using this class is the following:
 
1. Use the [GetInstance()()](https://www.graphicsmill.com/docs/gmwc/M_Aurigma_GraphicsMill_AjaxControls_FileCache_GetInstance.htm.md) method. This static method returns you an instance of the FileCache class.
2. Everytime you need to create a temporary file in the private cache (i.e. the file which should not be sent to the client), use the [GetPrivateTempFileName(String)](https://www.graphicsmill.com/docs/gmwc/M_Aurigma_GraphicsMill_AjaxControls_FileCache_GetPrivateTempFileName_1_bb3a7a4f.htm.md) method. It will generate the unique file name, append specified extension, and "register" it as a temporary file. To get a temporary file name for the public cache (i.e. the file which will be available for the download), use the [GetPublicTempFileName(String)](https://www.graphicsmill.com/docs/gmwc/M_Aurigma_GraphicsMill_AjaxControls_FileCache_GetPublicTempFileName_1_bb3a7a4f.htm.md) method.
3. To create the temporary file with the name generated at the previous step, you need to get a full path (including the path to the folder which contains a cache). Methods [GetAbsolutePrivateCachePath(String)](https://www.graphicsmill.com/docs/gmwc/M_Aurigma_GraphicsMill_AjaxControls_FileCache_GetAbsolutePrivateCachePath_1_bb3a7a4f.htm.md) and [GetAbsolutePublicCachePath(String)](https://www.graphicsmill.com/docs/gmwc/M_Aurigma_GraphicsMill_AjaxControls_FileCache_GetAbsolutePublicCachePath_1_bb3a7a4f.htm.md) prepend the path to the private and public cache correspondingly. This way you can pass the result string to the Save(String) method or any other method which creates a file.
4. If you need to convert a path to the temporary file into the URL, use the [GetRelativePublicCachePath(String)](https://www.graphicsmill.com/docs/gmwc/M_Aurigma_GraphicsMill_AjaxControls_FileCache_GetRelativePublicCachePath_1_bb3a7a4f.htm.md) method. It will prepend the virtual path to the specified filename.
 
## Inheritance Hierarchy
  
- [System..Object](http://msdn2.microsoft.com/en-us/library/e5kfa45b)
    - *+* Aurigma.GraphicsMill.AjaxControls..FileCache
 
## Thread Safety
 Static members of this type are not safe for multi-threaded operations. Instance members of this type are not safe for multi-threaded operations.
   
## See Also

### Reference

- [FileCache Members](https://www.graphicsmill.com/docs/gmwc/AllMembers_T_Aurigma_GraphicsMill_AjaxControls_FileCache.htm.md)
- [Aurigma.GraphicsMill.AjaxControls Namespace](https://www.graphicsmill.com/docs/gmwc/N_Aurigma_GraphicsMill_AjaxControls.htm.md)
