caching

Angular2 : The responses to HTTP get requests are being cached in IE

冷暖自知 提交于 2019-12-24 08:29:18
问题 The responses to most HTTP get requests are being cached in IE Edge. It doesn't happen in other browsers as far as I know. I fixed that on older versions, but How can I do it on Angular2? any help would be appreciated. 回答1: A common fix is to add a random query parameter value to the request URL. You can create a custom Http implementation that does that for each request. @Injectable() class NoCacheHttp extends Http { constructor(_backend: ConnectionBackend, _defaultOptions: RequestOptions) {

How to add version number to HTML file (not only to css and js files)

不羁的心 提交于 2019-12-24 08:09:07
问题 Many people use version numbers on css and js files to force non-cached versions to load up on webpages when updates are published: CSS example: <link rel="stylesheet" type="text/css" href="style.css?v=2017-03-17"> JS example: <script type="text/javascript" src="js/myscript.js?v=2017-03-17"></script> I've noticed that by adding version numbers to css/js files, the web browsers will also load up the HTML file (from which the css/js files are referenced from) from scratch and not use the cached

Memcache + Mysqli Couldn't fetch mysqli_result

梦想与她 提交于 2019-12-24 08:05:37
问题 I'm trying to add some speed performance to a project I'm working on using memcache. However I'm having a problem with the following public function sql_query($query){ $memcache = new Memcache; $memcache->connect('localhost', 11211) or die ("Could not connect"); $memkey = md5($query); $get_result = $memcache->get($memkey); if ($get_result){ return $get_result; } else { $q = $this->mysqli->query($query); $memcache->set($memkey, $q, false, 120) or die ("Failed to save data at the server"); if (

Zend Cache not working using Action Helper

梦想的初衷 提交于 2019-12-24 07:56:54
问题 I'm trying to implement full page static caching in my Zend Framework application. Using the Static backend coupled with the Capture frontend, whole pages can be cached, and served by a .htaccess redirect in the future, until the cache is deleted/regenerated. For reference, I've been using the section on Zend_Cache_Backend_Static in the manual, and also some further information provided by the class author. As per the example, I have configured the directories for the cache (static HTML files

OutputCache not let to change site language

寵の児 提交于 2019-12-24 07:46:54
问题 I want to use OutputCache to open pages quickly. I wrote in controller: public class HomeController : Controller { [OutputCache(Duration=3600,VaryByParam="none", VaryByCustom="lang")] public ActionResult Index() { //........ } public ActionResult ChangeCulture( string lang, string returnUrl ) { Session["Culture"] = new CultureInfo( lang ); return Redirect( returnUrl ); } } In Layout.cshtml: <a href="@Url.Action( "ChangeCulture", "Home", new { lang = "en", returnUrl = this.Request.RawUrl } )"

Clear cache for all possible query parameter url for specific url - CloudFlare

笑着哭i 提交于 2019-12-24 07:35:49
问题 How can I find all urls with every possible query parameters? There is specific curl command launched with terminal for do this? For example i must clear cache for url: example.com/, example.com/lang=en, example.com/lang=es, ... 回答1: If you pay for higher plans you can purge cache with wildcards, such as example.com/lang=* . Otherwise you'll have to enter each page in the list. You might be better off clearing the entire cache. 来源: https://stackoverflow.com/questions/42579658/clear-cache-for

CacheDependancy for multiple Cached items

可紊 提交于 2019-12-24 07:27:49
问题 I would like to have an item in the ASP.NET CacheObject, which if it were changed a number of dependant items would be removed So.. In a request If prompted and it exists in the cache remove the root object, all dependence will be removed too Check for root object in the cache, if it doesn't exist, add it Add other objects to the cache with a dependency on the root object When I do this I get an error " An attempt was made to reference a CacheDependency object from more than one Cache entry "

User on wrong session

冷暖自知 提交于 2019-12-24 07:17:15
问题 I've found articles that describe issues similar to mine but not close enough. I have a really intermittent problem where one user can land on another users session and end up seeing some of their information that's stored in a session. Here's my scenario: We use AbleCommerce in a load balanced environment using Application Request Routing and Web Farm Framework. We use in-proc sessions but we have sticky sessions (client/server affinity) configured and working. I've verified there is no

HTTP: What are the best headers for rarely changed images

大憨熊 提交于 2019-12-24 07:14:40
问题 I have many many small images that are displayed on a user's profile and the loading of this page is horrible. The best solution is to sprite them all, but sadly I have too many images for that and only a few hundred are used per profile. So, I'm trying to get the second best solution. What headers should I send? ETag? Expires? Cache-Control? Right now I have: http://metaward.com/media/award/ofwjh3.png Last-Modified Sat, 11 Jul 2009 22:37:49 GMT Cache-Control max-age=2592000 Expires Tue, 29

undefined method `fragment_for' for nil:NilClass on render partial with cache

人盡茶涼 提交于 2019-12-24 07:11:46
问题 I have this piece of code in a partial on some code for rails 2.3.14: <% cache "some_partial_#{some_id}" do %> .... <% end %> Works fine when rendering it in a view but I get: undefined method `fragment_for' for nil:NilClass when I try to do this in a model: ActionView::Base.new("app/views").render(:partial => "home/temp"} I can see the issue occuring in actionpack-2.3.14/lib/action_view/helpers/cache_helper.rb:35 def cache(name = {}, options = nil, &block) @controller.fragment_for(output