caching

Disable cache digests in Rails 4

吃可爱长大的小学妹 提交于 2020-01-15 17:32:04
问题 I'm in the process of migrating a Rails 3 app to Rails 4. The migration was mostly fairly smooth, but one big problem I'm encountering is that my old Rails 3 code to expire my caches isn't working. I'm getting logs like: Expire fragment views/localhost:3000/cardsets/36?action_suffix=edityes (0.0ms) ... Read fragment views/localhost:3000/cardsets/36?action_suffix=edityes/d8034b6e68ba30b5916a2ebb73b68ffe (0.0ms) This turns out to be because Rails 4 brings a new funky kind of caching, cache

Load from cache with window.location.reload and hash fragment in Chrome doesn't work

自作多情 提交于 2020-01-15 12:31:31
问题 I need to reload the page in Javascript. I use window.location.reload for that purpose. Now, I observe a strange behaviour in Chrome: Chrome always connects to the server and asks if the document was modified. Though a 304 Not Modified is returned, there is still a roundtrip to the server that I want to avoid. I've also tried explicitly using window.location.reload(false) to tell chrome to use the cache, but without success. Not that I have an active hash (#) fragment in the url that I reload

SimpleDiskCache inputStream bad number format

≡放荡痞女 提交于 2020-01-15 12:24:10
问题 I'm using the SimpleDiskCache code (github link) to cache a few video files to disk for an Android app I'm working. Here's how I put the video file to cache: OutputStream fil = videoCache.openStream(newData.getObjectId().toLowerCase()); fil.write(videoInBytes); fil.flush(); fil.close(); And here's the code where I want to retrieve the video file from cache: InputStream in = videoCache.getInputStream(newData.getObjectId().toLowerCase()).getInputStream(); File videoFile = Utils.createFile(Utils

Bitmap cache on DrawingVisual has blurry parts

喜夏-厌秋 提交于 2020-01-15 11:48:29
问题 Recently I switched to DrawingVisuals to increase the performance of our trending graphs (especially zooming and panning). Here's the code I have: blocksToBeRendered = (baseItem as AvgCurve).GetStreamGeometryBlocks(ActualWidth, ActualHeight, _minPoint.X, _maxPoint.X, FixTimeStep ? _timeStep : 0, IsMainChart); Pen stroke = new Pen((baseItem as AvgCurve).LineBrush, 1); foreach (GeometryGroup group in blocksToBeRendered) { if (group.Children.Count != 0) { if (!cachedBlocks[baseItem].Any(x => x

Caching and HTTPS

吃可爱长大的小学妹 提交于 2020-01-15 11:39:11
问题 I've noticed something interesting while monitoring the network communications between my browser and server. It has something to do with caching. Say I have a CSS file http://domain.com/main.css (used in unsecured pages), which can also be accessed via https://domain.com/main.css (used in secured pages). When I first load an unsecured page, the CSS file gets a 200 OK . When I reload the page (or go to another unsecured page), I get a 304 Not Modified . When I go to a secured page for the

Caching and HTTPS

匆匆过客 提交于 2020-01-15 11:39:08
问题 I've noticed something interesting while monitoring the network communications between my browser and server. It has something to do with caching. Say I have a CSS file http://domain.com/main.css (used in unsecured pages), which can also be accessed via https://domain.com/main.css (used in secured pages). When I first load an unsecured page, the CSS file gets a 200 OK . When I reload the page (or go to another unsecured page), I get a 304 Not Modified . When I go to a secured page for the

JPA 2 + EclipseLink : Caching Issue

只愿长相守 提交于 2020-01-15 10:57:19
问题 I have a strange behavior with caching and JPA Entities (EclipseLink 2.4.1 ) + GUICE PERSIST I will not use caching, nevertheless I get randomly an old instance that has already changed in MySQL database. I have tried the following: Add @ Cacheable (false) to the JPA Entity. Disable Cache properties in the persistence.xml file : <class>MyEntity</class> <shared-cache-mode>NONE</shared-cache-mode> <properties> <property name="eclipselink.cache.shared.default" value="false"/> <property name=

JPA 2 + EclipseLink : Caching Issue

拜拜、爱过 提交于 2020-01-15 10:57:05
问题 I have a strange behavior with caching and JPA Entities (EclipseLink 2.4.1 ) + GUICE PERSIST I will not use caching, nevertheless I get randomly an old instance that has already changed in MySQL database. I have tried the following: Add @ Cacheable (false) to the JPA Entity. Disable Cache properties in the persistence.xml file : <class>MyEntity</class> <shared-cache-mode>NONE</shared-cache-mode> <properties> <property name="eclipselink.cache.shared.default" value="false"/> <property name=

What caching strategy do you use for a Database dependant ASP.NET App?

孤人 提交于 2020-01-15 10:48:10
问题 I'm looking for a good caching strategy for an CRM App written in ASP.NET. Almost all sites depend heavily on the database, which means caching parts/the whole page for some time does not work in my situation. Is there any other way you use caching in these situations? UPDATE 1: The setup is the following: - ASP.NET App hosted on IIS - App uses either Entity Framework or nHibernate as OR Mapper as Data Access technology - which ever technology has more advantages for my specific requirements

How to clear MemoryCache in ASP.NET Core?

梦想的初衷 提交于 2020-01-15 10:15:32
问题 How to correctly clear IMemoryCache from ASP.NET Core? I believe this class is missing Clear method, but anyway how to deal with it? In my project I'm caching DocumentRepository's methods for 24 hours where I'm getting lots of rows from database. But sometimes I can change the database, so I want to clear the IMemoryCache as it has got rubbish data. 回答1: The cache class and interface don't have any methods for clearing neither ones to iterate over the keys, since it's not meant to be a list