Questions tagged [cache-invalidation]

Use cache-invalidation for questions related to purging content from a cache based on a state change in the cached object or a canonical object that it shadows

References

85 questions
1147
votes
57 answers

How to force browsers to reload cached CSS and JS files?

I have noticed that some browsers (in particular, Firefox and Opera) are very zealous in using cached copies of .css and .js files, even between browser sessions. This leads to a problem when you update one of these files, but the user's browser…
Kip
  • 107,154
  • 87
  • 232
  • 265
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
30
votes
3 answers

Jekyll Bootstrap based blog - Expire headers?

I have a Jekyll bootstrap based blog hosted on Github pages. My problem is: Every time I change something on my web page, I have to forcefully reload the page (CTRL + R) to see the changes. Jekyll or my browser does not seem to realize that there is…
Sebastian Hoitz
  • 9,343
  • 13
  • 61
  • 77
25
votes
6 answers

How to use Flask-Cache with Flask-Restful

How do I use Flask-Cache @cache.cached() decorator with Flask-Restful? For example, I have a class Foo inherited from Resource, and Foo has get, post, put, and delete methods. How can I can invalidate cached results after a…
cyberra
  • 579
  • 1
  • 6
  • 14
16
votes
8 answers

Error:Cause: invalid stream header: 000900D9 in android studio 2.3.1

I am using android studio 2.3.1 and it was working fine yesterday But now it throw me an error Error:Cause: invalid stream header: 000900D9 this message throw from Messages Gradle Sync dialog. Below are the steps which i did to fixed this problem…
Suraj Bahadur
  • 3,730
  • 3
  • 27
  • 55
13
votes
1 answer

Why does CLFLUSH exist in x86?

I recently learned about the row hammer attack. In order to perform this attack the programmer needs to flush the complete cache hierarchy of a CPU for a specific number of addresses. My question is: why is CLFLUSH necessary in x86? What are the…
11
votes
0 answers

Clear browser cache for CORS

I need to clear the cache for one file in Chrome. I was setting up loading a font from my own CDN, and added the cache-control: public, max-age=31536000, immutable header. However, I did not setup CORS correctly, so I got a CORS error. Now, that…
10
votes
2 answers

Get a string that represents a user's CanCan abilities

I want to cache a Post view, but the view depends on the permissions of the current user (e.g., I only show the "edit" link if current_user.can?(:edit, @post)) So I'd like my cache key to include a representation of the current user's CanCan…
Tom Lehman
  • 85,973
  • 71
  • 200
  • 272
9
votes
2 answers

Doctrine 2 result cache invalidation

I'm using Doctrine 2's result cache on a query retrieving the number of new messages of a user (messaging app): $query->useResultCache(true, 500, 'messaging.nb_new_messages.'.$userId); I tried to invalidate this cache like this (in my entity…
Nanocom
  • 3,696
  • 4
  • 31
  • 46
8
votes
1 answer

Force browser to clear cache in Angular environment

There is a popular question on how to force-clear the cache of the browser in a VanillaJS application, with the general consensus being, setting the name of the .js-script or the scripts arguments to a new value: Force browser to clear cache How can…
Phil
  • 7,065
  • 8
  • 49
  • 91
7
votes
2 answers

How to broadcast cache invalidate messages to all servers running a web app?

I have a Java based web app hosted on AWS. It is read-mostly so it makes a lot of sense to cache objects retrieved from the database for performance. When I do update an object, I would like to be able to broadcast to all the servers that the…
6
votes
1 answer

Docker cache invalidation

I'm having some weird issues with my custom Dockerfile, compiling a .Net core app in alpine containers. I've tried numerous different configurations to no avail - cache is ALWAYS invalidated when I implement the final FROM instruction (if I comment…
Spikeh
  • 3,540
  • 4
  • 24
  • 49
5
votes
1 answer

How can I detect/avoid updates to my cached React-based App? Or how can I detect a cache-invalidation before it happens?

I'm developing an app in React that does encryption on the client-side and sends the encrypted content back to the server for secure storage (e.g. think of online-wallets). This works well since the data is secure in case someone malicious gets…
Muppet
  • 5,767
  • 6
  • 29
  • 39
5
votes
0 answers

Cache invalidation using Webpack

I am appending hash ids to bundles generated by webpack. Whenever I get a new build I see that filenames are changed with new hash and index.html file is referencing these files. But after deploying my app, some users using Chrome don't see the new…
cubbuk
  • 7,800
  • 4
  • 35
  • 62
5
votes
1 answer

Invalidate Cache using VaryByCustom

I want to invalidate cache using VaryByCustom attribute. Following code is being used for cache setup. public override string GetVaryByCustomString(HttpContext context, string arg) { if (!string.IsNullOrWhiteSpace(arg)) { if…
1
2 3 4 5 6