How do I include a dynamic block in the product page with full page caching turned on?

Overview In order to answer I need to explain a little first. The Magento FPC process knows four states. Page in cache, no dynamic blocks Page in cache, dynamic blocks cached Page in cache, dynamic blocks not cached Page not in cache State 1 and 2 are processed without the full Magento application being initialized. … Read more

How to cache query result in ember data

I’m not an Ember expert but I think you can address your problem with a pure JS solution. Given Ember Data queries return Promises, e.g. return this.store.findAll(‘blog-post’); // => Promise, we can cache promises in a simple object with higher order functions (functions that return functions). The object cache could be replaced with localStorage, sessionStorage, … Read more

SDURLCache with AFNetworking and offline mode not working

Well I’ve finally reached a not so ugly workaround: First If you’re using IOS5/IOS6 you can drop SDURLCache and use the native one: //Set Cache NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:4 * 1024 * 1024 diskCapacity:20 * 1024 * 1024 diskPath:nil]; [NSURLCache setSharedURLCache:URLCache]; But remember that in IOS5 https requests wont be cached in IOS6 … Read more

.Net 4 MemoryCache Leaks with Concurrent Garbage Collection

You can “force” a garbage collection right after the problematic method and see if the problem reproduces executing: System.Threading.Thread.Sleep(200); GC.Collect(); GC.WaitForPendingFinalizers(); right at the end of the method (make sure that you free any handles to reference objects and null them out). If this prevents memory leakage, and then yes, there may be a runtime … Read more

How to disable webpage caching in ExpressJS + NodeJS?

There are two things to consider when dealing with cache in Express.js – ETag and Cache-Control headers. ETag (MDN reference) If you have dynamic content which does not benefit from ETags, it’s best to disable it because it incurs small overhead with each request. app.set(‘etag’, false) Cache-Control (MDN reference) To completely disable cache, use the … Read more

How to force Apache to use manually pre-compressed gz file of CSS and JS files?

Some RewriteRule should handle that quite well. In a Drupal configuration file I found: # AddEncoding allows you to have certain browsers uncompress information on the fly. AddEncoding gzip .gz #Serve gzip compressed CSS files if they exist and the client accepts gzip. RewriteCond %{HTTP:Accept-encoding} gzip RewriteCond %{REQUEST_FILENAME}\.gz -s RewriteRule ^(.*)\.css $1\.css\.gz [QSA] # Serve … Read more

Where and how to check that hibernate cache really works

You can enable Hibernate statistics generation be setting hibernate.generate_statistics property to true. Then you can monitor cache hit/miss count via SessionFactory.getStatistics(). Also, when SQL logging is enabled you can analyze cache behaviour by presence or absense of particular SQL queries. It depends on many factors. See 21.2. The Second Level Cache and 21.4. The Query … Read more