86d69f226224af63b84681953fd74e38932133e0
API/CodeSamples/DataCacheInterval.md
| ... | ... | @@ -1,3 +1,51 @@ |
| 1 | -###DataCache Interval: |
|
| 1 | +#DataCacheInterval |
|
| 2 | 2 | |
| 3 | -Sets the number of seconds between cache refreshes. Example: ``AdHocSettings.DataCacheInterval = 60 * 24 * 30;`` |
|
| ... | ... | \ No newline at end of file |
| 0 | +[[_TOC_]] |
|
| 1 | + |
|
| 2 | +##About |
|
| 3 | + |
|
| 4 | +Sets the number of seconds between cache refreshes for the FUSION (HTML) cache. If you have the FUSION add-on, enable FUSION (HTML) caching using this setting. HTML caching will produce a time stamp on your reports and dashboards showing the last time the report was run without the cache. HTML caching can significantly improve performance, especially if you have database connection or speed issues. |
|
| 5 | + |
|
| 6 | +**Default Value:** 0 |
|
| 7 | + |
|
| 8 | +##Global.asax (C♯) |
|
| 9 | + |
|
| 10 | +```csharp |
|
| 11 | +//main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig |
|
| 12 | +public class CustomAdHocConfig : Izenda.AdHoc.DatabaseAdHocConfig |
|
| 13 | +{ |
|
| 14 | + // Configure settings |
|
| 15 | + // Add custom settings after setting the license key and connection string by overriding the ConfigureSettings() method |
|
| 16 | + public static void InitializeReporting() { |
|
| 17 | + //Check to see if we've already initialized. |
|
| 18 | + if (HttpContext.Current.Session == null || HttpContext.Current.Session["ReportingInitialized"] != null) |
|
| 19 | + return; |
|
| 20 | + AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"; |
|
| 21 | + AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE"; |
|
| 22 | + Izenda.AdHoc.AdHocSettings.AdHocConfig = new CustomAdHocConfig(); |
|
| 23 | + AdHocSettings.DataCacheInterval = 60 * 24 * 30; //The relevant setting |
|
| 24 | + HttpContext.Current.Session["ReportingInitialized"] = true; |
|
| 25 | + } |
|
| 26 | +} |
|
| 27 | +``` |
|
| 28 | + |
|
| 29 | +##Global.asax (VB.NET) |
|
| 30 | + |
|
| 31 | +```visualbasic |
|
| 32 | +'main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig |
|
| 33 | +Public Class CustomAdHocConfig |
|
| 34 | + Inherits Izenda.AdHoc.DatabaseAdHocConfig |
|
| 35 | + |
|
| 36 | + Shared Sub InitializeReporting() |
|
| 37 | + 'Check to see if we've already initialized |
|
| 38 | + If HttpContext.Current.Session Is Nothing OrElse HttpContext.Current.Session("ReportingInitialized") IsNot Nothing Then |
|
| 39 | + Return |
|
| 40 | + 'Initialize System |
|
| 41 | + AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE" |
|
| 42 | + AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE" |
|
| 43 | + Izenda.AdHoc.AdHocSettings.AdHocConfig = New CustomAdHocConfig() |
|
| 44 | + AdHocSettings.DataCacheInterval = 60 * 24 * 30 'The relevant setting |
|
| 45 | + HttpContext.Current.Session("ReportingInitialized") = True |
|
| 46 | + End Sub |
|
| 47 | +End Class |
|
| 48 | +``` |
|
| ... | ... | \ No newline at end of file |