Tag Archives: cache
Caching credentials using System.Net CredentialCache in C#
The System.Net CredentialCache class provides storage for multiple credentials. Applications that need to access multiple resources can store the credentials for those resources in a CredentialCache instance that then provides the proper set of credentials for a given resource when … Continue reading
Microsoft Enterprise Library Caching block
Step 1: Download and install the Microsoft Enterprise Library 5.0, and then run EntLibConfig.exe. It should look like the image below Step 2: Select the Blocks menu item, click Add CachingSettings. It should look like the below mentioned image. Step … Continue reading
Cache thumbnail versions of an image and generate them if they do not exist
We can cache thumbnail versions of an image and generate them if they do not exist using .htaccess. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} -([0-9]+)x([0-9]+)\.(jpe?g|gif|png)$ [NC] RewriteRule ^(.*)-(.+)x(.+)\.(.{3,4})$ /thumb.php?file=$1.$4&width=$2&height=$3
Installing Memcached on Ubuntu
Follow the steps below to install memcached on ubuntu servers: Step 1: use apt-cache search $ apt-cache search memcached You should see a list of packages like libcache-memcached-perl–Cache::Memcached–client library for memcached libmemcache-dev–development headers for libmemcache C client API libmemcache0–C client … Continue reading
Installing Memcached on CentOS
To install memcached on a CentOS Linux server, follow these steps: Step 1: Start looking for the package [root@centosbox ~]# yum search memcached You should a set of packages like memcached.x86_64: High Performance, Distributed Memory Object Cache memcached-selinux.x86_64: SELinux policy … Continue reading
What is a catalogue table in caching?
When data is written to a caching system like memcached using write-back caching, it is also written to the database,asynchronously. This mechanism uses a separate process that needs to know what data items have been cached, and uses that information … Continue reading
Types of Caching in PHP Applications
Read-through caching: When a request is received, the application checks the cache first to see if the retrieved data is already cached. If the data is in the cache, it just returns that data without having to query the database. … Continue reading
How does memcached work?
Memcached is built with a slab allocator component that provides a hash lookup table where items are cached in memory. The hash table is networked using a non-blocking networking library libevent. This enables extremely fast performance. The important thing about … Continue reading
Csharp client side private caching
We can enable private caching if we specified a value of ‘Client’ for the Location attribute of an OutputCache directive on a page. This page would not be saved in the server cache but will be saved in the client’s … Continue reading
Csharp Programmatically Setting Page Caching
The example code below shows a page whose expiration is set programmatically and uses the sliding expiration scheme. The sliding expiration scheme means that whenever a page is hit, the timeout is reset. This ensures that only items that are … Continue reading
VaryByParam,VaryByHeader, VaryByControl, VaryByCustom OutputCache Directive Attributes
VaryByCustom Vary the output cache either by browser name and version or by a custom string, which must be handled in an overridden version of GetVaryByCustomString(). VaryByHeader A semicolon-separated list of strings representing headers submitted by a client. VaryByParam A … Continue reading
CSharp OutputCache Directive Example
The OutputCache directive is added to the header of any ASP.NET page. It specifies the duration (in seconds) that the page should be cached. The OutputCache directive example below specifies that this particular page should be cached for one hour … Continue reading