How to cache in a Blackberry BrowserField

I’ve been looking at your code, and the only thing I’ve found there’s wrong with it, is you are completely ignoring the possibility of response.getLength(); returning less than zero (in CacheManagerImpl.createCache()). Although this didn’t happen to me at the stackoverflow.com page, some pages use Transfer-Encoding: chunked, which means Content-Length is not present. This is, however, … Read more

What are the compelling reasons to use a MemoryCache over a plain old Dictionary

I think you nailed the two compelling reasons 🙂 The MemoryCache has an eviction strategy, so that it can throw out entries that are no longer needed or for that you do not have enough memory anymore. A Dictionary will not “lose contents”. Update: MemoryCache is thread-safe and has methods such as AddOrGetExisting. With a … Read more

How to “invalidate” portions of ASP.NET MVC output cache?

One way is to use the method : HttpResponse.RemoveOutputCacheItem(“/Home/About”); Another way is described here : http://aspalliance.com/668 I think you could implement the second method by using a method level attribute for every action that you want and just add to it the string representing the key. That’s if I understood your question. Edit: Yes the … Read more

Docker build is not using cache

From your Dockerfile, if you append lines to your Dockerfile, or change the code being built, there’s only one line that could be cached: RUN mkdir /code After that, you perform a: COPY . /code Since you have changed your Dockerfile, the contents of . have changed (the Dockerfile is part of .) and therefore … Read more

Caching in Android webview

Don’t use these: viewer.getSettings().setAppCacheMaxSize(1024*1024*8); viewer.getSettings().setAppCachePath(“/data/data/com.your.package.appname/cache”‌​); viewer.getSettings().setAppCacheEnabled(true); These have nothing to do with the default webview internal cache. Appcache is an entirely different feature mean to make you able to run the website w/o an internet connection. It does not work that great and probably you do not want to use it. With setting this: viewer.getSettings().setCacheMode(WebSettings.LOAD_DEFAULT) … Read more

Caching Data Objects when using Repository/Service Pattern and MVC

Steve Smith did two great blog posts which demonstrate how to use his CachedRepository pattern to achieve the result you’re looking for. Introducing the CachedRepository Pattern Building a CachedRepository via Strategy Pattern In these two posts he shows you how to set up this pattern and also explains why it is useful. By using this … Read more

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

This is the configuration I use for our ever-changing EC2 hosts: maxim@maxim-desktop:~$ cat ~/.ssh/config Host *amazonaws.com IdentityFile ~/.ssh/keypair1-openssh IdentityFile ~/.ssh/keypair2-openssh User ubuntu StrictHostKeyChecking no UserKnownHostsFile /dev/null This disables host confirmation StrictHostKeyChecking no and also uses a nice hack to prevent ssh from saving the host identify to a persistent file UserKnownHostsFile /dev/null note that as … Read more

How to retrieve a list of Memory Cache keys in asp.net core?

As other answers point out, current implementation of Microsoft.Extensions.Caching.Memory.MemoryCache does not expose any members allowing to retrieve all cache keys, although there is a way around the problem if we use reflection. This answer is partially based upon the one by MarkM, adds some speed to the solution by reducing reflection usage to a minimum, … Read more