VS 2005 - Clearing Cache All The Time?
Jun 22, 2011I have a new ASP.Net web project and every time I change anything in the CSS file I need to delete temp internet files before I can see my changes?
View 8 RepliesI have a new ASP.Net web project and every time I change anything in the CSS file I need to delete temp internet files before I can see my changes?
View 8 RepliesI have MVC 2 site, and I.E is cacheing word documents linked on my site. I know there is a way to clear cache before every action in the controller. But for these links i am not using action, i am just creating regular href links.. Is there anyway i can clear the cache?
View 2 Replies I'm running an ASP.NET MVC website where several page controllers are decorated with an output cache attribute like:
[OutputCache(Duration = someduration..., VaryByParam = "*")]
These are typically forms where some lookup data are drawn from a database. These data change rarely, so the cache duration is typically set to 24 hours. Anyway, my question is: when the sql server is updated with new data in this area, is there a way of forcing such pages to "refresh" rather than keeping the cached output? Or if this cannot be done, is there at least a way of clearing the whole cache for the website?
Users can edit images downloaded from my site and then upload them back using a WCF Web Service. The problem is when users go to view images, they often do not see the latest versions because of caching. I'd rather not turn off the cache because it substantially reduces bandwidth. Is there a way to have the Web Service perform some action upon an upload to notify the next web client call that the image has changed?
View 2 Repliesi have a rest url which inserts data, on insertion of the data i want to clear the cache?
View 1 RepliesI use this type of cache code on my pages
<%@ OutputCache Duration="60" VaryByParam="*" VaryByCustom="browser" %>
An issue by example. I have a page with the asp.net 2 (MSVS 2005) membership menu controls <asp:logonview etc on them. This control show different menus depending on if the member is logged on or not. I am using forms cookie authentication. The sequence of events. Page1 has the above cache settings and a logonview menu control on it. I am not logged on. I goto Page1. I view the page, and the logonvew control shows the button to logon. So correctly it has not detected a membership cookie and shows the logon button. I log on. I go back to page1, yet the logonview has not updated the menu for the newly logon status, as the page is sourced from the cache. I have to wait 60 seconds before the page can be rendered correctly. When the page is updated for logon status, the menu button for logon does not show, it should show Welcome Member Joe Bloggs. How can all pages cache be cleared when a log on happens, so there is not cache limbo, and the logonview menu control shows the correct status always?
I'm trying to cache user controls and on some pages i want to cache single objects. There are multiple ways of implementing caching, and my head is breaking over it.
The way I see the caching options now:
You have the PartialCaching option which is set to cache the control for 30 minutes, and after that it clears itself... You have the varyByParam to identity the page by its querystring paramaters... or other vary options
But i just cant find an appropriate way to add caching to a control, and be able to clear the caching programmatically when i update one of the objects used in the control from the backend.
You can do HttpContext.Current.Cache.Insert(), which accepts a key on which you can destroy the caching item later by using remove... This can save objects in cache but can you use options like varyByParam?
My questions are burnt down to two:
Is there a way to clear the caching on specific user controls from the code? If yes, can this be done according to the varyby options? How would the object caching respond to logged in users or anonymous users using Insert()?
EDIT: I'm caching multiple things.... And I'm really flabbergasted in which choice to make referring to caching. Can the Cache.Insert be varied by Parameters?
The main problem is peopling editing things from the backend, which needs to trigger an event that reinstantiates or clears all caching items referring that object.
In my asp.net web application I would like to clear all cache upon login when I click the back button in IE. I have tried various different ways but after I click the back button and then click the forward button it goes back to the submission aspx page with the same cache values. I am using master pages as well, if this makes any difference.
View 10 RepliesI create a menu control in a user contol, named as RightUserrControl.ascx.
and i kept this RightUserrControl.ascx in nearly in 200 pages.
every thing is working fine , but when ever i am going to any page the page loading is very slow, nearly each page is taking 1 minute to load.
set caching for the user control, if this is the case , do i need to declare output cache in all 200 pages or is there any alternative way to resolve this issue.
I'm having a real problem trying to get the SQLCacheDependancy working, whenever I add data to the Cache with a SQLCahceDependancy it is invalidated almost immediately. So when I try to access that cache key again it is always null.
My setup is as follows: SQL server 2005 (on remote machine)
Visual Studio 2005 ASP.NET 3.5 on Windows XP Machine.i have run the following script on the DB to set up permissions etc (these script are from various post):
-----------------------------------------------SQL Scripts start -----------------------------------------------------------------------------------------
use db_Company;
ALTER DATABASE db_Company SET ENABLE_BROKER;
[Code]....
What is the best method to cache the following? I am creating an intranet web application template that will display the message, e.g., Good Morning, Justin Satyr! near the top of my master page header. Obviously, I will have to determine whether to show Morning, Afternoon or Evening. For clarity, my code is below:
string partOfDay;
var hours = DateTime.Now.Hour;
if (hours > 16)
{
partOfDay = "evening";
}
else if (hours > 11)
{
partOfDay = "afternoon";
}
else
{
partOfDay = "morning";
}
I do not want to re-determine this on each page load because that seems moderately redundant and because I have to poll a SQL server to retrieve the user's full name. What is the best way to cache this nformation? If I cache it for the length of the session, then if the user begins using the application at 11:00 AM and finishes at 3:00 PM, it will still say Good Morning. Is the best thing to do simply re-determine the M/A/E word each page load and cache the person's full name for the session? Or is there a better way?
I have a navigation on my site that retrieves it's links from xml file..Does asp do this everytime a link is clicked on my site..I'm using a master page and the navigation code within the master page is below..So is the xml file opened and read each and every time? any way to cache it or something.below is my code
[Code]...
I am using System.Web.Caching.Cache in an assembly used by my website.
I have set some key expiration (absolute expiration) to be 10 seconds (just for debugging).
I have also set a callback upon key removal.
The problem is that I see that the cache is getting refreshed after something like 20 seconds and not 10.
I am using HttpRuntime.Cache for this.
I would like to show a code sample, which can shed more light:
[code]....
What could be the problem ?
I have an ASP.Net 4.0 web application which very frequently loads data from the database and does heavy calculations on it. I want to cache this loaded and prepared data in a central cache that can be accessed by every user and computer who uses the application.
Simple use-case:
User 1 accesses webpage, cache is empty, data is loaded/calculated, data is cached
User 2 accesses webpage, cache contains data, data loaded from cache
User 3 accesses webpage, cache contains data, data loaded from cache
User 1 reloads webpage, cache contains data, data loaded from cache
Cache expires
User 3 refreshes webpage, cache is empty, data is loaded/calculated, data is cached
I know that ASP.Net has a built-in cache mechanism. What I don't know is whether it can be shared between different users accessing the site on different computer at the same time. I would also like to know how the system behaves in a web farm environment.
i have simple form which consists of 2 labels and 2 buttons, the first label will display the current time and second label will display the cached time for 2 mins which is absolute..
no w when i click on first button only current time have to get update,, and when i click on second button both current time cached time have to be updated even though the cached time of 2 mins not elapsed also.
This source what i have used to create cache object.Also i have checked if "AppCache_Caption" cache object is available or not.
[Code]....
Right now i have checked and created my login page page_load event.It will create cache object every time me access the login page.What are the conditions wrong my source?My expectation, cache object creates only one time.It will not create everytime.
I wrote this code for inserting Items in shopping cart and I expect one day Shopping Cart Items be available.
if (Cache[username] == null)
{
ShoppingCart cart = new ShoppingCart();
[Code].....
and I face another problem that I think it's related to above problem. I have a cateogry of product when I click on a category I send categoryid via querystring to another page and fetch iformation about that from database and bind them in repeater this is first line of code
<asp:Repeater ID="rpt_lookpd" runat="server" EnableViewState="false">
I found product doesn't show in second page but before there wasn't this problem.
When I removed EnableViewState="false" It worked again.
[URL]
This is probably simple, but from an ASP.NET web page, how would I get the current time as EST, regardless of what time it is on the server (the server of course being located in a time zone other than EST)?
View 5 Repliesi need to create div on run time in such a manner as it create table at run time,(table is also in another div) .
all my rows in table like this (for example)
Code:
[code]....
let me tell u one more thing above div is sub div of many other divs .how i will access how to add runtime to design time div?
I want to store date and time into SQL server. Can I store it directly? For Instance
strDate = 28/02/2011
strTime = 09:30:55 pm
Then I used one variable to store all these.
strDateTime = strDate + " " + strTime
But it doesn't work for me
i have a project created in asp.net 2.0. i want to calcuate how much time user spend on my site ???
i can do it by using (logout time - login time) ...but what happens if user directly close the browser by clicking [X] button..
i want to write query in run time in SSRS.is it possible??...
View 1 RepliesI have a report running on sql report server 2005. When export the time field to xls using report server 2005 export, xls shows the time field in a huge negative number.
View 4 Repliesi have a query that select random records in access database in terms of time : "SELECT TOP 10 * FROM Tbl ORDER BY Rnd(-10000000*TimeValue(Now())*[ID])" now i wish to convert this query for using in sql server 2005 such that return random records in term of time
View 5 RepliesI have a web portal designed in ASP.NET in which we ask customers to enter the data. On the click of submit button all i have done is, just read the data and called a stored procedure which inserts that into a table. There seems to be a problem in SQL Server 2005 while inserting the data from multiple computers at the same time. We have tested in our lab with three computers, result is that we get the data inserted successfully in only one machine and on the other two machines we get error on page. I have used transactions in the stored procedure and also tried setting the isolation levels to READ_UNCOMMITTED, SERIALIZABLE and SNAPSHOT. Nothing seems to work properly.
View 4 Replies