Questions tagged [caching]

Questions regarding cache algorithms by applications and implementations of information caching by database engines and other information repository and presentation applications.

Filter by
Sorted by
Tagged with
3 votes
2 answers
4k views

Pattern for caching DAOs: strategy or decorator?

I'm building a php system with the Services/DAOs/Domain Models pattern, and now is the time to implement a caching system for the DAOs. Would you use a decorator pattern, or maybe the strategy ...
  • 177
3 votes
1 answer
286 views

Object caching in this code too expensive?

I'm having some trouble with a game developed in Java which is kinda slow. I benchmarked it a little bit and found the problem: most of the time, the JVM is in the Object.<init>() since there ...
  • 594
2 votes
2 answers
489 views

Serving a Website as only Cached HTML Pages

Lets say that I want to develop a website where all pages will be dynamically generated and 'printed' into static HTML files. I will then serve these HTML files from a container (such as an Amazon ...
  • 159
3 votes
1 answer
4k views

Redis strategy for cache item dependency

I'm implementing cache structure using Redis, my domain is like this: There are multiple categories (3000+ categories). Each category contains multiple questions (around 20-30 questions per category)....
13 votes
0 answers
2k views

Caching Strategy: WCF Buffer pooling and size

I am currently trying to understand the best configuration for caching. I am using Azure In-Role caching (currently Colocated, but Dedicated at a later point) in a Web Api 2 application in .NET 4.5.1....
  • 887
0 votes
1 answer
1k views

design for buffering or queuing data streams to replace database

We have a system (ms stack, .net, sql) that receives data from thousands of remote devices (several independent readings/min). We currently save all the data to a db as it arrives and a second service ...
  • 153
2 votes
1 answer
223 views

ASP.NET how to handle external application settings

I'm converting an application from C# WebForms to MVC. The application gets settings from a centralized location using Web Services. These are settings you would typically find in a Web.Config, but ...
31 votes
3 answers
28k views

Dealing with browser cache in single-page apps

I'm trying to figure out how to properly handle the web browser cache for single page apps. I have a fairly typical design: several HTML, JS and CSS files implementing the SPA, and a bunch of JSON ...
1 vote
1 answer
257 views

Storing and presenting custom table data

I have a web site upon which I want to provide users the ability to create tables of data. These tables will come from a predefined list of table definitions of which I will be adding to myself. This ...
  • 195
2 votes
1 answer
476 views

Where to store front-end data for "object calculator"

I recently have completed a language library that acts as a giant filter for food items, and flows a bit like this :Products -> Recipes -> MenuItems -> Meals and finally, upon submission, ...
2 votes
4 answers
2k views

Optimizing code by using registers, but what if they are not enough in number?

One way to optimize code is to minimize the access to arrays and use variables instead, because that way we use registers instead of loading data to cache memory. For example, if in a loop I'm going ...
  • 145
1 vote
1 answer
1k views

URLs with variable query strings and cache

I am developing a media server, the basic functionality is to serve an image, which is done the following way /media/:id where :id is the id of the image. You may want to ask for a specific size, ...
2 votes
1 answer
492 views

PHP Cache Strategy - Genius or Sheer Stupidity?

I have a shared hosting with limited capabilities. Memcache and mod_cache are not available to me. I would like to implement my own PHP caching method to cache the results of load-intensive SQL query. ...
user avatar
3 votes
1 answer
2k views

Caching large amount of ajax returned objects

I'm building an application which fetches large amount of items with ajax requests via other application API. It returns me 6k - 30k js objects which are used multiple times across various application ...
1 vote
2 answers
2k views

Image caching when rendering the same images on different pages [closed]

I'm told to think about caching of images that will be displayed on the page. The images will be repeated throughout the website on different pages and I'm told to figure out the best way to cache ...
1 vote
0 answers
65 views

efficient caching with complex user rights

I am currently learning about memcached/redis, and I am trying to figure out how could I use this kind of technology at work. Now I understand that you should mostly cache data which is common to ...
  • 7,890
2 votes
1 answer
1k views

Cache concurrency: ensuring latest version in cache

We have a data service app working on object graphs. We place some complex graphs in a (memory) caching tier as a single data item, so as to avoid the length of time to retrieve every individual data ...
  • 171
3 votes
3 answers
2k views

Best practices for caching search queries

I am trying to improve performance of my ASP.net Web Api by adding a data cache but I am not sure how exactly to go about it as it seems to be more complex than most caching scenarios. An example is I ...
61 votes
6 answers
44k views

Why is CPU cache memory so fast?

What makes CPU cache memory so much faster than main memory? I can see some benefit in a tiered cache system. It makes sense that a smaller cache is faster to search. But there must be more to it.
0 votes
2 answers
820 views

Intel Nehalem/SB/IB/Haswell CPUs, cache vs TLB

On the Nehalem+ architecture Intel CPUs what is the interaction between the L1 cache, L2 cache, L1 DTLB and L2 DTLB? On all the images I have found there isnt a clear explanation whether the CPU looks ...
  • 1,441
0 votes
1 answer
144 views

Mail Server Caching

I'm currently working on a web mail client. When a user logs in, I'm fetching all the mails from the INBOX from the beginning of time. As expected this is pretty darn slow. I'm planning to implement ...
1 vote
1 answer
2k views

Should processing/filtering be performed client side or server side for catalog based apps

Device targeting for product XML catalog We currently have a webservice that outputs an XML of products based on get parameters in the request. The webservice is consumed from a windows mobile ...
  • 267
1 vote
2 answers
4k views

What is the best way to build a static page web site from a JSON API?

I have a JSON API that includes some discusssions. I want to build a static html site on another server, pages that are built from data on that API. I am more comfortable using Rails than Node. The ...
  • 157
1 vote
1 answer
982 views

Are there any concerns with using a static read-only unit of work so that it behaves like a cache?

Related question: How do I cache data that rarely changes? I'm making an ASP.NET MVC4 application. On every request the security details about the user will need to be checked with the area/...
3 votes
3 answers
6k views

How do I cache data that rarely changes?

In my ASP.NET application there is some data that doesn't change often and so there is no point in querying the database to re-check it every time. In my current situation I am checking user ...
1 vote
1 answer
301 views

Complex knowledge management system with CRM..written internally

We've all heard of salesforce and sugarcrm and the likes of systems like this. Unfortunately at my workplace we have been asked to write a similiar system (rather then license or purchase). Basically ...
  • 304
1 vote
0 answers
2k views

Understand how the TLB (Translation Lookaside buffer) works and interacts with pagetable and addresses

So I am trying to understand this TLB (Translation Lookaside Buffer). But I am having a hard time grasping it. in context of having two streams of addresses, tlb and pagetable. I don't understand ...
  • 151
2 votes
1 answer
4k views

AngularJS dealing with large data sets (Strategy)

I am working on developing a personal temperature logging viewer based on my rasppi curl'ing data into my web server's api. Temperatures are taken every 2 seconds and I can have several temperature ...
  • 121
3 votes
1 answer
448 views

At what point does caching become necessary for a web application?

I'm considering the architecture for a web application. It's going to be a single page application that updates itself whenever the user selects different information on several forms that are ...
4 votes
1 answer
1k views

API Caching Layer

Primer: We have a mobile app being served by an API (written in PHP). The main point of the app is to display products from a large items table in the database, in a multitude of different ...
  • 141
5 votes
1 answer
4k views

Pointer access and cache coherency

To my understanding, when you access a variable, that variable and the surrounding area of memory is put into the L1 cache. If I'm wrong here, please tell me. Now my question is, say I have an array ...
14 votes
1 answer
6k views

Why do some websites showing 0 bytes in Chrome's developer tools

I am doing a page speed optimization for my website and studying how other websites do it. I noticed that some websites such as as Facebook or Ringgitplus show 0 bytes for some of their resources in ...
11 votes
3 answers
11k views

What is a battery backup up cache?

I've read an article about Innodb performance optimization an in that post the author was repeatedly mentioning someting named a "battery back up cache". It is not clear for me what he was talking ...
  • 1,190
1 vote
3 answers
1k views

Add javascript to all pages (for caching), or only to the pages that require the scripts (for a smaller page size)?

I'm using bits of javascript on my website for an image gallery, smooth scrolling, etc. These scripts are not used on every page (not every page has an image gallery for example). However, the scripts ...
user avatar
1 vote
2 answers
1k views

Preventing Web Site Users From Using Their Back Button To Get To Cached Screens After Logging Out?

I have a legacy Java webapp ( Spring 3.1 MVC, legacy servlest and JSPs ) I have modified to log the user out after s/he clicks an external link to leave the web site. The last screen(s) s/he was on ...
  • 121
7 votes
1 answer
418 views

Hardware that accelerates pointer dereferencing?

Most modern languages make a heavy use of pointers / references: a typical OOP language uses VMT lookups, a typical functional language builds key data structures out of pointers, etc. Even typical C ...
  • 24k
1 vote
2 answers
114 views

What to call objects that may delete cached data to meet memory constraints?

I'm developing some cross-platform software which is intended to run on mobile devices. Both iOS and Android provide low memory warnings. I plan to make a wrapper class that will free cached resources ...
  • 113
0 votes
3 answers
790 views

How do I handle 3rd party search result data (via cache)

I have a search function on my site and it is taking data from 6 different 3rd party resources. The problem is, it takes too long requesting the data over and over again on the results page. I've ...
1 vote
2 answers
1k views

Multiple orders in a single list

I have a problem with a ranking system I am using. Scenario: An online game with around 10k players calculates a real time ranking of points when a certain event occurs. Events don't occur that ...
  • 301
0 votes
1 answer
208 views

Running entire frontend of a system on a flatfile cache

I'm in the middle of moving away from PyroCMS to a custom solution built on Laravel. Wont go into the details as to why here, but it is a necessity. I'm toying with the idea of caching things like ...
  • 131
3 votes
1 answer
976 views

Delivering and caching files in asp.net

The question is - what is an effective way to deliver files to users? Consider an asp.net application which gives an ability to view various files. A kind of image library or web file directory. Key ...
  • 185
1 vote
1 answer
235 views

Invalidate cache over multiple applications

We have a suite of applications including a website, a client application and multiple windows services. All these applications work on the same dataset and use an in-memory cache. Of course, this ...
  • 111
4 votes
2 answers
2k views

caching on multiple servers

Because we need to keep response times low, we get tons of requests, and we need to basically process ALMOST the same data (which I'll refer to as X) each request (the inputs are different though, so ...
  • 297
13 votes
3 answers
13k views

What are best practices for caching paginated results whose ordering/properties can change?

What is the best practice for caching paginated search results whose ordering/properties can be changed? Say, in my application, someone wants to see the last 20 discussion threads (out of 10,000). A ...
7 votes
1 answer
3k views

How cache works in ServiceStack web services

I am new to caching and trying to understand how it works in general. Below is code snippet from ServiceStack website. public object Get(CachedCustomers request) { //Manually create the Unified ...
  • 929
1 vote
1 answer
49 views

When to apply corrections on data gathered from a server

I have an program that collects data from other servers. I don’t have access to these servers so I can’t change anything. The servers can give incorrect data, I can solve the problem but I’m a little ...
  • 227
3 votes
4 answers
364 views

Senior team members want to move query-relevant persistent data from DB to cache. Does this make sense?

I am a young engineer recently employed at a small company that sells products to the general public. We use Ruby On Rails and MySQL. Our database has a lot of customer data, but a great deal more of "...
user avatar
19 votes
6 answers
32k views

Best practices for unit testing methods that use cache heavily?

I have a number of business logic methods that store and retrieve (with filtering) objects and lists of objects from cache. Consider IList<TObject> AllFromCache() { ... } TObject FetchById(...
1 vote
1 answer
132 views

Are "conditional" caching policies ever actually useful?

I'm designing an abstraction over ASP.Net's built in caching to make it not so horrible to use. One design decision I'm having to look at is if I should restrict people to using just one cache policy ...
  • 22.6k
14 votes
2 answers
2k views

Shared Cache - Invalidation Best Practice

I'd like to know what would be a better approach to invalidate/update cache objects. Prerequisites Having remote memcached server (serving as cache for multiple applications) All servers are hosted ...
  • 1,009