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
216
votes
23 answers

Clear the cache in JavaScript

How do I clear a browsers cache with JavaScript? We deployed the latest JavaScript code but we are unable to get the latest JavaScript code. Editorial Note: This question is semi-duplicated in the following places, and the answer in the first of the…
subramani
212
votes
12 answers

AngularJS disable partial caching on dev machine

I have problem with caching partials in AngularJS. In my HTML page I have:
where my partials are loaded. When I change HTML code in my partial, browser still load old data. Is there any workaround?
Mennion
  • 2,873
  • 3
  • 20
  • 34
211
votes
7 answers

Cache an HTTP 'Get' service response in AngularJS?

I want to be able to create a custom AngularJS service that makes an HTTP 'Get' request when its data object is empty and populates the data object on success. The next time a call is made to this service, I would like to bypass the overhead of…
Gavriguy
  • 3,068
  • 3
  • 19
  • 23
206
votes
2 answers

Redis cache vs using memory directly

I have not used Redis yet, but I heard about it and plan to try it as cache storing. I heard Redis using memory as cache store database, so what's the difference if I use a variable as an object or dictionary datatype to store data? like: var cache…
hh54188
  • 14,887
  • 32
  • 113
  • 184
203
votes
8 answers

Disable browser cache for entire ASP.NET website

I am looking for a method to disable the browser cache for an entire ASP.NET MVC Website I found the following method: Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache); Response.Cache.SetNoStore(); And also a meta tag method (it…
Palani
  • 8,962
  • 11
  • 53
  • 62
200
votes
8 answers

Laravel 5 Clear Views Cache

I notice that Laravel cache views are stored in ~/storage/framework/views. Over time, they get to eat up my space. How do I delete them? Is there any command that could? I tried php artisan cache:clear, but it is not clearing the views cache. With…
basagabi
  • 4,900
  • 6
  • 38
  • 84
199
votes
9 answers

Programmatically get the cache line size?

All platforms welcome, please specify the platform for your answer. A similar question: How to programmatically get the CPU cache page size in C++?
oz10
  • 153,307
  • 27
  • 93
  • 128
199
votes
14 answers

What is the difference between buffer and cache memory in Linux?

To me it's not clear what's the difference between the two Linux memory concepts : buffer and cache. I've read through this post and it seems to me that the difference between them is the expiration policy: buffer's policy is first-in,…
James.Xu
  • 8,249
  • 5
  • 25
  • 36
185
votes
3 answers

Notepad++ cached files location

On the most recent versions of Notepad++, when the application is closed, unsaved files are maintained when the application is restarted. I presume that those files are cached on a temporary files. What is the location of that file(s). Thank you
RedEagle
  • 4,418
  • 9
  • 41
  • 64
182
votes
15 answers

Spring Cache @Cacheable - not working while calling from another method of the same bean

Spring cache is not working when calling cached method from another method of the same bean. Here is an example to explain my problem in clear way. Configuration:
Bala
  • 4,427
  • 6
  • 26
  • 29
180
votes
25 answers

How to force Chrome browser to reload .css file while debugging in Visual Studio?

I'm currently editing a .css file inside of Visual Studio 2012 (in debug mode). I'm using Chrome as my browser. When I make changes to my application's .css file inside of Visual Studio and save, refreshing the page will not load with the updated…
duyn9uyen
  • 9,585
  • 12
  • 43
  • 54
179
votes
15 answers

How does one write code that best utilizes the CPU cache to improve performance?

This could sound like a subjective question, but what I am looking for are specific instances, which you could have encountered related to this. How to make code, cache effective/cache friendly (more cache hits, as few cache misses as possible)?…
goldenmean
  • 18,376
  • 54
  • 154
  • 211
178
votes
4 answers

Clear MySQL query cache without restarting server

Is there any way to clear mysql query cache without restarting mySQL server?
Mahoor13
  • 5,297
  • 5
  • 23
  • 24
175
votes
21 answers

How would you implement an LRU cache in Java?

Please don't say EHCache or OSCache, etc. Assume for purposes of this question that I want to implement my own using just the SDK (learning by doing). Given that the cache will be used in a multithreaded environment, which datastructures would you…
Hank Gay
  • 70,339
  • 36
  • 160
  • 222
172
votes
19 answers

How to clear APC cache entries?

I need to clear all APC cache entries when I deploy a new version of the site. APC.php has a button for clearing all opcode caches, but I don't see buttons for clearing all User Entries, or all System Entries, or all Per-Directory Entries. Is it…
lo_fye
  • 6,790
  • 4
  • 33
  • 49