caching

Are modern CPU caches optimized to deal with constant strides? Across threads?

Say I have a big array, and multiple threads reading from the array. Each thread iterates through the array by jumping a constant amount, but starts at a different offset. So thread 1 may start at element 0, then read elements 32, 64, 96, etc. But thread 2 starts at element 1, and read element 33, 65, 97, etc. (keeping in mind that an 'e...

Caching to a local SQL instance on a web server

I run a very high traffic(10m impressions a day)/high revenue generating web site built with .net. The core meta data is stored on a SQL server. My team and I have a unique caching strategy that involves querying the database for new meta data at regular intervals from a middle tier server, serializing the data to files and sending those...

ASP.NET MVC Response Filter + OutputCache Attribute

I'm not sure if this is an ASP.NET MVC specific thing or ASP.NET in general but here's what's happening. I have an action filter that removes whitespace by the use of a response filter: public class StripWhitespaceAttribute : ActionFilterAttribute { public StripWhitespaceAttribute () { } public override void OnResultExecuted(Resul...

How to use ReadWriteLock ?

Hello, I'm the following situation. At web application startup I need to load a Map which is thereafter used by multiple incoming threads. That is, requests comes in and the Map is used to find out whether it contains a particular key and if so the value (the object) is retrieved and associated to another object. Now, at times the co...

ExpertPDF and Caching of URLs

We are using ExpertPDF to take URLs and turn them into PDFs. Everything we do is through memory, so we build up the request and then read the stream into ExpertPDF and then write the bits to file. All the files we have been requesting so far are just plain HTML documents. Our designers update CSS files or change the HTML and rerequest...

Extending ASP.NET data cache to be shared across web farm

I have an ASP.NET application that makes extensive use of ASP.NET cache API for caching commonly-used data. In addition, I am using polling-based sql cache dependency to track expiration. The drawback of the current design is that, in the web farm environment, each web server has its own data cache that is not shared across servers. Is...

Header page caching

I'm using the below headers on my web site but I'm running into a problem. The first time I visit my site for the day I don' tsee my ACP link. There are also instances where information is in our database that only registered members can create, but the form is still being loaded for non-logged in users so information is being created ...

MySQL MyISAM disk-bound scaling issue / drive cache

I have the following lookup-table: CREATE TABLE `widgetuser` ( `widgetuserid` char(40) NOT NULL, `userid` int(10) unsigned NOT NULL, `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`widgetuserid`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 DELAY_KEY_WRITE=1; I have a widgetuser_tmp Table with the same structu...

phpThumb cache problems

I'm using phpThumb - the PHP thumbnail generator. 'phpThumb.config.php': $PHPTHUMB_CONFIG['cache_maxage'] = 10; $PHPTHUMB_CONFIG['cache_maxsize'] = 1000; $PHPTHUMB_CONFIG['cache_maxfiles'] = 10; but it does nothing... I've got 108 MB in 922 files... and it keeps growing. Thanks for any suggestions. ...

Java application hanging if network is modified

I am working on an eclipse app that has got multiple views. From these views I have to access some data over the wire. An error is thrown in following scenario. Step 1: Start app, everything works fine. Step 2: Disable network Step 3: Enable Network Step 4: Try to access data over wire from one of the views. The app apparently hangs. St...

SSH on Linux: Disabling host key checking for hosts on local subnet (known_hosts)

I work on a network where the systems at an ip address will change frequently. They are moved on and off the workbench and DHCP determines the IP they get. It doesn't seem straightforward how to disable host key caching/checking so that I don't have to edit ~/.ssh/known_hosts every time I need to connect to a system. I don't care ab...

https caching of resources used by main php script, NOT the script itself

I'm a little confused here. I read some of the earlier questions on https caching but I didnt get a clear answer. I've got a script sitting on: https://www.example.com/main.php It generates an html page that refers to images/css/js resources sitting (relatively) at: /css /javascript /images /a/b/img2 How do I enable caching for these...

jqueryui caching resize alsoresize

I'm resizing something inside a tab. I want to also resize a different element in the same tab. However, selecting that element is relatively slow, using :visible to figure out which tab panel is visible, and so on. I want to cache the selection, but how? Does alsoResize even accept an object? // The actual selection is more complex tha...

Hosting static images on subdomain

What are the benefits of hosting your images on a subdomain such as "img.domain.com"? If you're not on a CDN is there any real benefit to this? Update So doing this with CSS and JS files would also serve the same purpose? ...

Role Caching Strategies in ASP.NET MVC

We have an ASP.NET MVC application for which we have developed our own custom RoleProvider class. Without caching it will access the datastore for every request - bad. The only caching option we can find is (in web.config) via cookies stored on the clients' machines. My two questions are: Is this secure (even with encryption enabled)? ...

Configuring Rails CSS Caching with Passenger

I am using Passenger and Rails' :cache => true to cache all my css into one big file. Deploys are done via Capistrano. Now sometimes(!), the mem-generated all.css file can't be found after the app is restarted (and I get an error in the log) ActionController::RoutingError (No route matches "/stylesheets/all.css" with {:method=>:get}): ...

Reloadable cache

I need to store a lookup map in memory on a servlet. The map should be loaded from a file, and whenever the file is updated (which is not very often), the map should be reloaded in the same thread that is doing the lookup. But I'm not sure how to implement this functionality in a thread safe manner. I want to make sure that the reload d...

How to Persist a DataSet to The Database when the Server is Rebooted

I have a dataset in cache and I don't want to lose the information in the cache even if the server is rebooted. Is there a way to do this? ...

losing my objects at cache

I am using IIS7 and c# and mysql. and I put some objects into asp.net cache system with sql keywords. it has very simple logic.put the selected dataset into cache with the given sql keyword. here is the problem. when I call my site with www.abc.com it works normal. while surfing in abc.com after second click firstly filled dataset becom...

cakephp + cache + formhelper inside <cake:nocache></cake:nocache> = error

in all my views i have a login/register (cake)form. my question: can i use the file cache engine with <cake:nocache>form</ cake:nocache> 1.) open url "www.domain.com/home" 2.) cachefile generated 3.) look perfect 4.) refresh (f5) 5.) error (when debug=1): Parse error: parse error in C:\xampp\htdocs\cake_1.2.3.8166\app\tmp\cache\...