Questions tagged [caching]

A cache is a mechanism for temporarily storing (caching) data locally in order to reduce access time to data stored far away. For CPU/disk/web browsing please use relevant tags (cpu-cache, diskcache,...)

A cache is a mechanism that involves temporarily storing data in places that are faster to access than the original storage location. can be machine code instructions, images, documents, or web pages, for example. The purpose of a cache is to reduce access time, bandwidth usage, server load, and perceived lag.

Different applications where cache mechanisms are used include:

Useful Links

37958 questions
150
votes
14 answers

Stop Chrome Caching My JS Files

I will make a change to my JS files but it won't really change in the browser, I have to rename the files every time so that it reloads it. Is there some sort of .htaccess command I can add or something to make it stop caching? It is even caching…
Howdy_McGee
  • 10,422
  • 29
  • 111
  • 186
149
votes
3 answers

How to configure static content cache per folder and extension in IIS7?

I would like to set up rules in IIS7 for static content caching in my ASP.NET website. I have seen these articles, which details how to do it using the element in web.config: Client Cache (IIS.NET) Add Expires or Cache…
frankadelic
  • 20,543
  • 37
  • 111
  • 164
147
votes
3 answers

Chrome memory cache vs disk cache

I am interested in chrome memory cache vs disk cache? I use webpack, common chunks plugin and generate all my files with chunkhash. How does memory differ from disk cache. When I reload my page some files are loaded from memory cache and some from…
Igor-Vuk
  • 3,551
  • 7
  • 30
  • 65
146
votes
8 answers

How to prevent Browser cache on Angular 2 site?

We're currently working on a new project with regular updates that's being used daily by one of our clients. This project is being developed using angular 2 and we're facing cache issues, that is our clients are not seeing the latest changes on…
Rikku121
  • 2,536
  • 2
  • 23
  • 38
146
votes
17 answers

How to turn off caching on Firefox?

During development I have to "clear cache" in Firefox all the time in order to make it use the latest version of JavaScript files. Is there some kind of setting (about:config) to turn off caching completely for JavaScript files? Or, if not, for all…
Thilo
  • 257,207
  • 101
  • 511
  • 656
144
votes
18 answers

Android image caching

How can I cache images after they are downloaded from web?
d-man
  • 57,473
  • 85
  • 212
  • 296
144
votes
15 answers

Is there a Python caching library?

I'm looking for a Python caching library but can't find anything so far. I need a simple dict-like interface where I can set keys and their expiration and get them back cached. Sort of something like: cache.get(myfunction, duration=300) which will…
Stavros Korokithakis
  • 4,680
  • 10
  • 35
  • 42
142
votes
2 answers

Is it fine if first response is private with AppCache (Symfony2)?

I'm trying to use http caching. In my controller I'm setting a response as follows: $response->setPublic(); $response->setMaxAge(120); $response->setSharedMaxAge(120); $response->setLastModified($lastModifiedAt); dev mode In dev environment first…
Jakub Zalas
  • 35,761
  • 9
  • 93
  • 125
140
votes
5 answers

Tomcat 8 throwing - org.apache.catalina.webresources.Cache.getResource Unable to add the resource

I have just upgraded Tomcat from version 7.0.52 to 8.0.14. I am getting this for lots of static image files: org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/base/1325/WA6144-150x112.jpg] to the cache because…
iainmac999
  • 1,569
  • 2
  • 13
  • 12
140
votes
16 answers

Android Webview - Completely Clear the Cache

I have a WebView in one of my Activities, and when it loads a webpage, the page gathers some background data from Facebook. What I'm seeing though, is the page displayed in the application is the same on each time the app is opened and…
Matt Gaunt
  • 9,434
  • 3
  • 36
  • 57
140
votes
17 answers

Gmail's new image caching is breaking image links in newsletter

I've got some automatic emails that are sent out upon signup completion for my site. Until recently, they worked fine. Now Google's new system is rewriting the images and storing them in its cache (supposedly) However, Google's new rewriting of my…
RonnyKnoxville
  • 6,166
  • 10
  • 46
  • 75
134
votes
13 answers

Disable cache for some images

I generate some images using a PHP lib. Sometimes the browser does not load the new generated file. How can I disable cache just for images created dynamically by me? Note: I have to use same name for the created images over time.
dole doug
  • 34,070
  • 20
  • 68
  • 87
133
votes
12 answers

What is causing "Unable to allocate memory for pool" in PHP?

I've occasionally run up against a server's memory allocation limit, particularly with a bloated application like Wordpress, but never encountered "Unable to allocate memory for pool" and having trouble tracking down any information. Does anyone…
jonathanatx
  • 1,603
  • 3
  • 12
  • 13
132
votes
5 answers

remove all variables except functions

I have loaded in a R console different type of objects. I can remove them all using rm(list=ls()) or remove only the functions (but not the variables) using rm(list=lsf.str()) My question is: is there a way to remove all variables except the…
RockScience
  • 17,932
  • 26
  • 89
  • 125
132
votes
9 answers

Cache Invalidation — Is there a General Solution?

"There are only two hard problems in Computer Science: cache invalidation and naming things." Phil Karlton Is there a general solution or method to invalidating a cache; to know when an entry is stale, so you are guaranteed to always get fresh…
Greg
  • 316,276
  • 54
  • 369
  • 333