Cache Dependency On File - Not Firing The Event?

Sep 27, 2010

I configured cache dependency on a file on the server, the cache dependency event stops responding to file changes once in 2 or 3 days. After I perform IISReset on the server, it works fine.

View 1 Replies


Similar Messages:

C# - Caching W/file Dependency: Static Var Vs. AspNet Cache Vs. Memcached

Sep 29, 2010

TL;DR: Which is likely faster: accessing static local variable, accessing variable stored in HttpRuntime.Cache, or accessing variable stored in memcached?At work, we get about 200,000 page views/day. On our homepage, we display a promotion. This promotion is different for different users, based on their country of origin and language.

All the different promotions are defined in an XML file on each web server. We have 12 web servers all serving the same site with the same XML file. There are about 50 different promotion combinations based on country/language. We imagine we'll never have more than 200 or so (if ever) promotions (combinations) total.

The XML file may be changed at any time, out of release cycle. When it's changed, the new definitions of promotions should immediately change on the live site. Implementing the functionality for this requirement is the responsibility of another developer and I.

Originally, I wrote the code so that the contents of the XML file were parsed and then stored in a static member of a class. A FileSystemWatcher monitored changes to the file, and whenever the file was changed, the XML would be reloaded/reparsed and the static member would be updated with the new contents. Seemed like a solid, simple solution to keeping the in-memory dictionary of promotions current with the XML file. (Each server doing this indepedently with its local copy of the XML file; all XML files are the same and change at the same time.)

The other developer I was working holds a Sr. position and decided that this was no good. Instead, we should store all the promotions in each server's HttpContext.Current.Cache with a CacheDependency file dependency that automatically monitored file changes, expunging the cached promotions when the file changed. While I liked that we no longer had to use a FileSystemWatcher, I worried a little that grabbing the promotions from the volitile cache instead of a static class member would be less performant.

(Care to comment on this concern? I already gave up trying to advocate not switching to HttpRuntime.Cache.)

Later, after we began using HttpRuntime.Cache, we adopted memcached with Enyim as our .NET interface for other business problems (e.g. search results). When we did that, this Sr. Developer decided we should be using memcached instead of the HttpRuntime (HttpContext) Cache for storing promotions. Higher-ups said "yeah, sounds good", and gave him a dedicated server with memcached just for these promotions. Now he's currently implementing the changes to use memcached instead.

I'm skeptical that this is a good decision. Instead of staying in-process and grabbing this promotion data from the HttpRuntime.Cache, we're now opening a socket to a network memcached server and transmitting its value to our web server.This has to be less performant, right? Even if the cache is memcached. (I haven't had the chance to compile any performance metrics yet.)On top of that, he's going to have to engineer his own file dependency solution over memcached since it doesn't provide such a facility.

Wouldn't my original design be best? Does this strike you as overengineering? Is HttpRuntime.Cache caching or memcached caching even necessary?

View 2 Replies

Custom Server Controls :: How To Programmatically Cache A Server Control And Add A Cache Dependency?

Feb 11, 2011

I have a server control that I developed which generates navigation based on a third party CMS API. Currently I am caching this control using the PartialCaching attribute. The CMS uses cache key dependencies to invalidate the cache when a user makes an edit, however in the case of my server control it does not get invalidated and the updated navigation will not show up until the cache expiration set by the PartialCaching attribute.Here is my two part question:

What is the proper way to programmatically cache a server control, without using the PartialCaching attribute, and adding a cache key dependency?

Is it possible to continue to use the PartialCaching attribute and add a cache key dependency?

View 2 Replies

How To Enable SQL Cache Dependency

Jul 5, 2010

I think there are some steps to enable SQL Cache Depdndency :Enabling notifications, changes in web.xml and then using Cache Dependency object.

View 2 Replies

SQL Cache Dependency Not Working With Stored Procedure

Feb 22, 2010

I can't get SqlCacheDependency to work with a simple stored proc (SQL Server 2008):

create proc dbo.spGetPeteTest
as
set ANSI_NULLS ON
set ANSI_PADDING ON [code]...

And here's my ASP.NET code (3.5 framework):

-- global.asax
protected void Application_Start(object sender, EventArgs e)
[code]....

View 4 Replies

How To Setup Caching For A Page In .NET And Give It A Cache Key Dependency

Feb 15, 2011

How do I setup caching for a Page in ASP.NET and give it a cache key dependency? I am familiar how to do this with a UserControl, I set a Partial Caching attribute and then set

this.CachePolicy = new CacheDependency(..)

How would I do this for a Page? It does not have a CachePolicy object,

View 1 Replies

SQL Server :: Unable To Connect To The SQL Database For Cache Dependency Registration

Aug 25, 2010

i am trying to setup SqlCacheDependency with MS SQL Server 2008, i am using
aspnet_regsql.exe cmd line tool. I am able to enable it for database but when try to do it for table i get the following error message.Enabling the table for SQL cache dependency.

.An error has happened. Details of the exception: Login failed for user 'myUserName'.

Unable to connect to the SQL database for cache dependency registration.

View 1 Replies

State Management :: SQL Server Based Cache Dependency Without Data Source Control?

May 29, 2010

I want to use SQL Server based Cache dependency without data source control.How can I do it?I am binding data to grid through code.

View 5 Replies

Use OnLoad Event To Check If There Is A Cache File For This Module?

Dec 27, 2010

We are writing a portal and like every portal we store html data in Db fro Modules. So I thought that I can cache each module in files. I use OnLoad event to check if there is a cache file for this Module, use that and else create cache file:

if (!IsPostBack)
{
string Path = AppDomain.CurrentDomain.BaseDirectory + "CacheModules" + ModuleId + ".dat";
if (File.Exists(Path))
{
Controls.Clear();........

View 1 Replies

C# - Button Event Firing / More Redirecting In The File Only This One?

Jul 22, 2010

I am using an asp Button the following way:

<asp:Button ID="ButtonSave" runat="server" Text="Save" OnClick="ButtonSave_Click" />
and the code of the handler looks something like this:
protected void ButtonSave_Click(object sender, EventArgs e)
{
Authenticate();
//some other code here
//redirect to certain page here
}

While debugging, I put a breakpoint at Authenticate, but it seems that it doesn't enter the function, although the redirection takes place and i don't do any more redirecting in the file only this one.

View 1 Replies

Web Forms :: Firing Event In Class File?

May 7, 2010

I have a form that contains a Table control. The columns and rows are created dynamically, so there needs to be a way to maintain the state of the table. The table ALSO has textboxes within it that will fire a postback and update a database entry when the text has changed. Kind of like an excel-type configuration.

Anyways, I figured the best way to do this was to create a class object to create a standardized way of creating the Table, and then storing it in the Session. Every page reload I then readd the table to the form, so it looks like it is maintaining state.

Now, everything works fine and dandy, but my textboxes have an event handler which is stored in the class file. I can type in the textboxes and the form reposts, but the TextChanged event never fires.

Here's my code for the file:

[Code]....

And here is the page that utilizes it:

[Code]....

View 2 Replies

SQL Server :: Server Cache Dependency Enable Tables?

Aug 25, 2010

Using the [Code].... for server cache Dependency, to get a list of the tables that are enabled, We use the line below:

[Code]....

View 2 Replies

AsyncPostBack Firing On Child Textbox Trigger, But TextChanged Event Not Firing?

Jan 22, 2010

I'm sure I'm missing something extremely obvious here, but at this point I can't see it so I need the help.Anyway, I've got a repeater inside of an UpdatePanel. As of right now, I've stripped it down to this, just to try and isolate the problem:

[Code]....

Whether I add the handler during itemdatabound or I add the handler within the repeater itself, it doesn't seem to matter...the event itself doesn't fire. The AutoPostback itself seems to fire, but the event itself doesn't.

View 3 Replies

Web Forms :: Firing Click Event On A User-control That Is Created From Another Event?

Mar 1, 2011

I have a gridview called gvResults. In the gvResults_RowEditing event I add a row below the one selected. In that new row, which spans all columns, I insert a user-control. There are two buttons and some textboxes in the user control.

My problem is that when I click one of the user-control buttons it never gets to the button event handler, I think because the user control is not recreated on the page postback. How can I have the user-control events fire before the parent page events fire?

I tried using an update panel, but I still get the parent posting back before the user-control events.

View 3 Replies

Forms Data Controls :: CheckBox Checked Changed Event Is Firing For Every Control Event?

May 8, 2010

I am facing one strange problem,I have a gridview in which the last two columns have checkboxes and on those checkboxes click event I am doing some database operations.I also have one checkbox that is outside the gridview which actually shows or hides some of the gidview columns.This was all working well but now I have shifted that grid to a user control because I have to use it in two pages.The problem now is,When the page first loads and I click the check box or any control in the page that is outside the grid then it works perfectly.But once I click any of the check box within grid view column then its behavior chages, now even if I click the checkbox that is outside the grid then also the checkbox_CheckedChanged event of the checkbox that is whithin gridview is fired.That checkbox event then behaves something like a page_load event that is called for every page load and for every event with in the page after it is called once.

View 3 Replies

Button Not Firing Event

Sep 10, 2010

I have a page containing a datagrid, which works. On that page I have a button which is supposed to trigger a download of the data from the datagrid in Excel format. However, the button isn't firing the event. The C# code-behind I have is:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using umbraco;
namespace MyDataExport
{
public partial class DataExport : System.Web.UI.UserControl
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
GridView1.DataSource = BindData();
GridView1.DataBind();

[Code....]

View 1 Replies

Check_changed Event Is Not Firing?

Jul 22, 2010

I have a grid view within that i have child gridview,one coloumn of child gridview is bound to check box all thease are in update panel,

i have made checkbox autopostback="true",but check_changed() event is not firing

View 1 Replies

C# - Ext.Net Button Event Not Firing?

Feb 10, 2011

I am using Ext.Net and I have a problem.

I am creating dynamic buttons. It is working but if i click, the button event is not working.:(

My code:

foreach (var events in eventsInformation)
{
Ext.Net.Button btn = new Ext.Net.Button();
btn.ID = events.EvtId.ToString();
btn.Text = events.EvtName;
btn.Click += new EventHandler(Tickets_click);
ViewPort1.Controls.Add(btn);
}

View 2 Replies

C# - MenuItemClick Event Not Firing?

Apr 4, 2010

I am using asp:menu.In this asp menu,on clicking menu item,I want to get the menuitem,and its parent.I tried to use menuitemclick event.But menuitemclick event is not firing on clicking menu item.

View 1 Replies

Tab Container - Button Event Is Not Firing

Mar 21, 2010

In tab container let say I have two tabs [Tab1 & Tab2] Tab1 has 2 text box with required field validator Tab2 has 3 text box with required field validator Now even if I am filling all the text boxes in the TAB1, it is not allowing me to postback. [because TAB2 text boxes are still empty] & When I am filling all the textboxes [Both Tab1 & Tab2], button is firing correctly. I mean user has to fill details for the TAB1 & can submit the details. At that Time I don't want TAB2 validations to work.

View 1 Replies

Web Forms :: Button_Click Event Is Firing Twice?

Jan 6, 2011

I've stepped through the code and verified this action. It gets to the end sub and just loops again. Also does it on the production server in IE and Chome (that's all I've tried). Here is the button definition on the actual ASP page:

[Code]....

It goes through the code, sends me an email, gets to End Sub, then loops right back to the top of the sub and goes through the whole thing again, sending me a duplicate email, then exiting normally and sending them to the About page. This is the only code in the aspx.vb besides the class def and inherits statement.

View 2 Replies

Why GridView / RadioButton Is Not Firing An Event

Nov 4, 2010

I have a gridview with rows of data and a group of radio buttons for each row that can be selected. But when selected the event never fires for the radio dropdown.... why?

[code]....

View 2 Replies

Textchanged Event Of Textbox Is Not Firing?

Apr 6, 2010

when the user comes out of a texbox, i need to read the text entered in the textbox.

I tried using the textchanged event. But it is not firing when i move out of the textbox.

View 7 Replies

Event Of Master Page Not Firing

Jul 23, 2010

I put a break point at the protected void Page_Load(object sender, EventArgs e) method of my master page, but when i start the site it does not hit that break point.

Why is the event not firing? I would like to use this event along with others such as the Init event in order to check to see if the session has expired everytime a page loads...

View 4 Replies

C# - GridView 'CheckedChanged' Event Only Firing Once?

Mar 1, 2011

I have a GridView, which features a a checkbox on each row (in a template field), where it calls a method upon checked changed (well, when they click submit - no auto post back)

My problem is, the checked change refuses to fire more than once - if I just change the check state of one checkbox in the grid, it works fine. More than one and it only fires the event once.

EDIT: Bit of code:

<asp:CheckBox ID="chkIncludedLocal" runat="server" Checked='<%# Bind("Included") %>'
Enabled="true" OnCheckedChanged="chkIncludedLocal_CheckedChanged" />

And in the event, I put a breakpoint right at the top to see how many times it fires

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved