caching

How to determine optimum prepared statement cache size when using Hibernate

AFAIK, Hibernate transforms all sql to prepared statement form before issuing it to the database. When tuning the application, the size of prepared statement cache can be an important factor. How to determine the optimum value when using Hibernate, given that it creates prepared statements “under the hood”. ...

Multiple read from an InputStream at different rates

I'm about to load an online content (say an audio file). If I just open a connection to the remote file (for example by use of new URL().openStream()) and pass the remote InputStream to the audio player, it reads gradually from the network. If audio player library do not ask InputStream for more data, it reads nothing from the network, a...

Cache data in SQL CE database

Background I have an SQL CE database, that is constantly updated (every second). I have a (web) application that allows a user to look at the data in real-time. At some point a user can click "take a snapshot" button, and it will open the snapshot in a different window. And then on that form, there is "print" and "download" buttons that...

Using JavaScript, how can I prefetch another web page on my site?

I have Large.html, which is a web page that has a lot of images and javascript on it which takes a long time to load. From other pages (a.html, b.html) how can I use JavaScript to prefetch Large.html (and all of the elements on the page) so that I can get the page cached in the users browser to help speed up page loading. Would I need ...

How to cache separate instances of user control depending upon a property value

Hi, I've an asp.net user control called UC_Test which has got a public property exposed called param1.It is hosted in aspx pages A and B. On page A, param1 is set to 10 and on page B param1 is set to 20. Depending on the param value, the formatting of user control is controlled. I want page A and page B to cache separates instances of...

How do I cache a web page in PHP?

how do I cache a web page in php so that if a page has not been updated viewers should get a cached copy? Thanks for your help. PS: I am beginner in php. ...

Non-Transparent Proxy Caching of SSL

I asked the question before but didn't phrase it quite right. I'm using RESTful principles to build a secure web-app that uses both transport authentication/encryption and message level security. The message level security is essentially client-independent (still encrypted though), and hence this allows the individual messages to be cac...

How do I best make triggered accessors with defaults in Moose?

I have a situation where I'd like to cache some calculations for use later. Let's say I have a list of allowed values. Since I'm going to be checking to see if anything is in that list I'm going to want it as a hash for efficiency and convenience. Otherwise I'd have to grep. If I'm using Moose it would be nice if the cache was recalc...

Java: Data structure for caching computation result?

I have an expensive computation, the result of which I'd like to cache. Is there some way to make a map with two keys? I'm thinking of something like Map<(Thing1, Thing2), Integer>. Then I could check: if (! cache.contains(thing1, thing2)) { return computeResult(); } else { return cache.getValue(thing1, thing2); } pseudocode. But...

Why I can’t find any benefit of caching LINQ to Entity query?

Please look at my sourcecode. public class EntityQuery { public static Func<AdventureWork2008Container, IQueryable<SalesPerson>> selectQuery = CompiledQuery.Compile ( (AdventureWork2008Container aw) => ( from s in aw.SalesPerson join e in aw.Employee on s.BusinessEntityID equals e.Business...

Why does stored procedure invalidate SQL Cache Dependency?

After many hours, I finally realize that I am working correctly with the Cache object in my ASP.NET application but my stored procedures stops it from working correctly. This stored procedure works correctly: CREATE PROCEDURE [dbo].[ListLanguages] @Page INT = 1, @ItemsPerPage INT = 10, @OrderBy NVARCHAR (100) = 'ID', @OrderDirection NV...

IIS7 + ASP.NET MVC Client Caching Headers Not Working

Hey folks I've deployed an ASP.NET MVC app on IIS7 and Windows Server 2008. I've read posts on here, and around the web, but can't get the darn client-side caching to work. I'm trying to cache everything in the /Content folder. So far I've select that folder in IIS manager, and set the appropriate HTTP Response Headers (under Common ...

Caching architecture for search results in an ASP.NET application

What is a good design for caching the results of an expensive search in an ASP.NET system? Any ideas would be welcomed ... particularly those that don't require inventing a complex infrastructure of our own. Here are some general requirements related to the problem: Each search result can produce include from zero to several hundred ...

How do sites like LinkedIn efficiently display 1st/2nd/3rd-level relationship next to each person's name?

I recently botched a job interview by poorly answering a straightforward question: how do sites like LinkedIn efficiently show the relationship distance (1st/2nd/3rd) from you to every person displayed on a page (e.g. in people search results, list of people working in a company, etc.)? <EDIT> I got the essential "trick" of the solution...

First level cache doesn't update when using FetchMode.Join

Hi, I'm having a problem with the first level cache in NHibernate in our web application. In our application we have a context based session that is alive during each request (opened on request start and closed on request end). In addition to this we have a model structure with User, Organization and OrganizationType such that each Use...

Caching in PHP.

We run a number of web applications written in PHP. Unfortunately there are some select queries within these with some pretty hefty joins which are causing MySQL to become less responsive. Because of this we are looking into caching some of the regularly used joins. I have looked into Zend_Cache which looks promising, are there any oth...

Restricting the use of back button without JavaScript

I'm currently involved in an ASP.NET project where I need to restrict the users ability to go back in the page structure using the back button. It is essentially a wizard style navigation and I don't want to give the user the ability to go back from the last step and re-submit the data. JavaScript is not an option unfortunately, so I "so...

Clever caching using generics?

Are there any clever layers out there to sit on top of the System.Web.Caching.Cache class to handle simple scenarios to fetch items using generics. I'd like to maybe provide a delegate function to retrieve an item, and be able to fetch an item with a strongly typed GetItem and a delegate function to retrieve an item if it isnt found. F...

Can a Windows Service access Cache Objects in a Web Page?

Hello, I have created a windows service and I would like it to access a web cache. I have stored a datatable in web cache and I would like for my windows service to access and process it. Is this possible? ...

WURFL's New API Question

Hi all, I have a simple stupid question. Here's the problem, for years, my company has been using the old WURFL PHP API. Now, with the release of the new WURFL PHP API that promises a better performance, we want to use it. What I want to ask is, how do I update the cache? Can I use the old *update_cache.php*? ...