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

35446 questions
10
votes
3 answers

Prevent Chrome from caching a site's DNS records

Chrome caches DNS records and tends to ignore changes to the hosts file after it has successfully connected to my site (barring a restart). With DNS pre-fetching enabled, it is even more pronounced. Are there any page headers that will instruct…
Petrus Theron
  • 25,051
  • 30
  • 137
  • 263
10
votes
2 answers

Service Worker: cache.match(request) returns undefined

I have a simple service worker, that adds two resources (index.html, app.js) to the cache (on install), deletes old caches (on activate) and serves the resources from cache if present, else from the network (on fetch). To get the new service worker…
tobik
  • 1,129
  • 1
  • 8
  • 9
10
votes
2 answers

OutputCache behavior in ASP.NET MVC 3

I was just testing Output Caching in the RC build of ASP.NET MVC 3. Somehow, it is not honoring the VaryByParam property (or rather, I am not sure I understand what is going on): public ActionResult View(UserViewCommand command) { Here,…
kidoman
  • 2,252
  • 5
  • 23
  • 33
10
votes
1 answer

How to get cached responses using Alamofire while app is in offline?

After I got a response via Alamofire, in some cases, implementing a database or managing local storage myself (file etc.) can be a bit overkill. I know about Alamofire's requestCachePolicy and it is already caching responses (based on…
Jakub Truhlář
  • 15,319
  • 7
  • 65
  • 73
10
votes
3 answers

Objective-C cpu cache behavior

Apple provides some documentation about synchronizing variables and even order of execution. What I don't see is any documentation on CPU cache behavior. What guarantees and control does the Objective-C developer have to ensure cache coherence…
John K
  • 722
  • 1
  • 7
  • 14
10
votes
1 answer

Clearing the "cached" memory in /proc/meminfo without drop_caches

I have an embedded system running 2.6.10 linux kernel (I know!) and I noticed that as the system stays up for longer periods of time, the "cached" usage of RAM - as seen in /proc/meminfo - increases linearly. Sometimes it reaches up to 70% of total…
Ram
  • 1,151
  • 1
  • 10
  • 34
10
votes
2 answers

Is it possible to cache Videos? IOS - Swift

I am trying to download and play videos in a tableView like Instagram, vine or even facebook. What I am trying to achieve is a tableView where I display the videos and they auto download and play while scrolling. Like Instagram... So far I have…
user5590595
10
votes
4 answers

How to know if NSURLSessionDataTask response came from cache?

I would like to determine if the response from NSURLSessionDataTask came from cache, or was served from server I'am creating my NSURLSessionDataTask from request.cachePolicy = NSURLRequestUseProtocolCachePolicy;
Peter Lapisu
  • 18,394
  • 14
  • 107
  • 163
10
votes
3 answers

Django Rest Framework Cache Headers

I'm trying to cache some of my DRF api calls in a CDN. I need the following headers Cache-Control:public, max-age=XXXX This is pretty easy when you're using traditional django templating, you just add the @cache_page() @cache_control(public=True)…
mcgruff14
  • 189
  • 12
10
votes
2 answers

Does Go cache DNS lookups?

I am building a test crawler and wanted to know if Go (golang) caches DNS queries. I don't see anything about caching in the dnsclient. This seems like an important thing to add to any crawler to prevent lots of extra DNS queries. Does Go (1.4+)…
Xeoncross
  • 50,836
  • 73
  • 238
  • 351
10
votes
4 answers

CPU Cache disadvantages of using linked lists in C

I was wondering what were the advantages and disadvantages of linked-list compared to contiguous arrays in C. Therefore I read a wikipedia article about linked-lists. https://en.wikipedia.org/wiki/Linked_list#Disadvantages According to this article,…
ouphi
  • 167
  • 1
  • 8
10
votes
1 answer

Understanding caching?

Yesterday, we had no power at home, thus no Internet. So I assumed that I wouldn't be able to have my web-app work locally, since at the end of "index.html" I have:
gsamaras
  • 66,800
  • 33
  • 152
  • 256
10
votes
2 answers

How to cache an HTTP POST response?

I would like to create a cacheable HTTP response for a POST request. My actual implementation responses the following for the POST request: HTTP/1.1 201 Created Expires: Sat, 03 Oct 2020 15:33:00 GMT Cache-Control:…
KARASZI István
  • 28,974
  • 8
  • 95
  • 116
10
votes
3 answers

How to use redis for number of micro-services?

I am very much new to redis. I have been investigating on redis for past few days.I read the documentation on cache management(lru cache), commands ,etc. I want to know how to implement caching for multiple microservice(s) data . I have few…
kaarthick raman
  • 375
  • 2
  • 8
  • 27
10
votes
3 answers

Caching variables in the $_SESSION variable?

I'm making a php web application which stores user specific information that is not shared with other users. Would it be a good idea to store some of this information in the $_SESSION variable for caching? For example: cache a list of categories the…
menko
  • 332
  • 4
  • 12
1 2 3
99
100