File Caching: Query string vs Last-Modified?

TL;DR Why do so many websites use the “query string” method, instead of just letting the last-modified header do its work? Changing the query string changes the url, ensuring content is “fresh”. Should I unset the Last-modified header and just work with query strings? No. Though that’s almost the right answer. There are three basic … Read more

Why doesn’t perf report cache misses?

On my system, an Intel Xeon X5570 @ 2.93 GHz I was able to get perf stat to report cache references and misses by requesting those events explicitly like this perf stat -B -e cache-references,cache-misses,cycles,instructions,branches,faults,migrations sleep 5 Performance counter stats for ‘sleep 5’: 10573 cache-references 1949 cache-misses # 18.434 % of all cache refs 1077328 … Read more

Using static keyword in objective-c when defining a cached variable

Static variables retain their assigned values over repeated calls to the function. They’re basically like global values that are only “visible” to that function. The initializer statement is only executed once however. This code initializes dateFormatter to nil the first time the function is used. On every subsequent call to the function a check is … Read more

How to disable caching with HttpClient get in Angular 6

Using meta HTML tags, Disable browser caching:- <meta http-equiv=”cache-control” content=”no-cache, must-revalidate, post-check=0, pre-check=0″> <meta http-equiv=”expires” content=”0″> <meta http-equiv=”pragma” content=”no-cache”> or, Add headers in http request as:- headers = new Headers({ ‘Cache-Control’: ‘no-cache, no-store, must-revalidate, post- check=0, pre-check=0’, ‘Pragma’: ‘no-cache’, ‘Expires’: ‘0’ });

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

You may be able to leverage axioms about small world networks to optimize this type of traversal. Small world networks are characterized by “hubs” the represent very dense interconnections of other nodes. Most nodes in the network will generally either connect within a few hops to a topologically nearby node (1-4 hops away) or will … Read more

How to find and fix a Rails and Couchbase memory leak

There is no terminating condition in your loop so it’s going to run forever and cause the memory issue you mentioned. You should add a relevant break condition in your loop and test if it resolves the issue. def loop_bucket_gets bucket = Couchbase::Bucket.new({:node_list => [‘xxx.xxx.xxx.xxx:8091’, ‘yyy.yyy.yyy.yyy:8091’], :bucket => ‘Foo’, :pool => ‘default’, :expires_in => 1.day, … Read more