How do you set the expiry date or a maximum age in the HTTP headers for static resources in IIS

Leverage browser caching: Setting an expiry date or a maximum age in the HTTP headers for static resources instructs the browser to load previously downloaded resources from local disk rather than over the network. http://code.google.com/speed/page-speed/docs/caching.html#LeverageBrowserCaching To set an expiry date or a maximum age in the HTTP headers for static resources Open IIS manager-> Click … 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

Stop browser to make HTTP requests for images that should stay cached – mod_expires

The behavior you are seeing is the intended (see RFC7234 for more details), specified behavior: All modern browsers will send HTTP requests to the server for every page element displayed, regardless of cache status. This was a design decision made at the request of web services (especially advertising networks) to ensure that HTTP servers were … Read more

Repository Pattern – Caching

It’s a good idea not to put the caching logic directly into your repository, as that violates the Single Responsibility Principle (SRP) and Separation of Concerns. SRP essentially states that your classes should only have one reason to change. If you conflate the concerns of data access and caching policy in the same class, then … Read more

How to cache Google map tiles for offline usage?

If you are trying to cache the tiles that Google serves, that may be a violation of Google’s Terms of Service (unless, under certain circumstances, if you’ve purchased their enterprise Maps API Premier). That’s why gmapcatcher has it crossed off their list. See http://code.google.com/p/gmapcatcher/issues/detail?id=210. At the gmapcatcher URL above, you will also find a shell … Read more

How does direct mapped cache work?

Okay. So let’s first understand how the CPU interacts with the cache. There are three layers of memory (broadly speaking) – cache (generally made of SRAM chips), main memory (generally made of DRAM chips), and storage (generally magnetic, like hard disks). Whenever CPU needs any data from some particular location, it first searches the cache … Read more

Force IE8 *not* to use Compatibility View

In the absence of an X-UA-Compatible http-equiv header, the compatibility mode is determined by the !DOCTYPE (or the absence of a !DOCTYPE, as the case may be). For a chart of which !DOCTYPE gives you which mode (in various browsers) see here: http://hsivonen.iki.fi/doctype/ (You’ll need to scroll down toward the bottom of the page.) You … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)