keep-alive

Vue 中的keep-alive 什么用处?

China☆狼群 提交于 2019-12-02 05:46:56
keep-alive keep-alive是Vue提供的一个抽象组件,用来对组件进行缓存,从而节省性能,由于是一个抽象组件,所以在v页面渲染完毕后不会被渲染成一个DOM元素 <keep-alive> <loading></loading> </keep-laive> 当组件在keep-alive内被切换时组件的activated、deactivated这两个生命周期钩子函数会被执行 被包裹在keep-alive中的组件的状态将会被保留,例如我们将某个列表类组件内容滑动到第100条位置,那么我们在切换到一个组件后再次切换回到该组件,该组件的位置状态依旧会保持在第100条列表处 作者:羊烊羴 链接: https://www.jianshu.com/p/4b55d312d297 来源:简书 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。 来源: https://www.cnblogs.com/whyaza/p/11732677.html

Angular 6 ng-idle

人盡茶涼 提交于 2019-12-02 05:03:05
I have an Angular Project which is working well and I'm implementing NG-IDLE and KeepAlive in order to keep the session fresh and to log a user out before the API session expires. My issue is that the ng-idle is also operating on the login page, which is obviously not required, as when it does time out, it will take the person to the login page. So I have the ng-idle and KeepAlive up and running in my app.component.ts but since I'm using lazy loading, I also have an authentication.module.ts and a login.component.ts. The code in my root app.component.ts is as follows: import { Component } from

How to disable keepalive in NSURLConnection?

不羁岁月 提交于 2019-12-01 23:18:25
问题 Is there any way to force NSURLConnection to not reuse the current persistent connection but to create a new one ? I am trying to defend myself from this known iOS8 keep-alive bug If iOS 8 receives a HTTP response with a Keep-Alive header, it keeps this connection to re-use later (as it should), but it keeps it for more than the timeout parameter of the Keep-Alive header and then when a second request comes it tries to re-use a connection that has been dropped by the server. I am looking for

How to disable keepalive in NSURLConnection?

£可爱£侵袭症+ 提交于 2019-12-01 21:32:26
Is there any way to force NSURLConnection to not reuse the current persistent connection but to create a new one ? I am trying to defend myself from this known iOS8 keep-alive bug If iOS 8 receives a HTTP response with a Keep-Alive header, it keeps this connection to re-use later (as it should), but it keeps it for more than the timeout parameter of the Keep-Alive header and then when a second request comes it tries to re-use a connection that has been dropped by the server. I am looking for a way to solve this issue from Objective c rather than solving from server side. If any third party

Azure Web Api - Waiting Sql Connection every 4 minutes and 30 minutes

社会主义新天地 提交于 2019-12-01 16:52:10
问题 Within a request on an ApiController, I'm tracking the duration of awaiting the Sql Connection to open. await t.TrackDependencyAsync(async() => { await sqlConnection.OpenAsync(); return true; }, "WaitingSqlConnection"); If my request is not called for at least 5 minutes, then any new call will see the duration of OpenAsync be huge (c. 3s) instead of immediate. I'd like to understand the reason to eradicate that crazy slowness. UPDATE I created an endpoint just to open the SqlConnection . If I

Pros and Cons of Keep-Alive from Web Server Side

安稳与你 提交于 2019-12-01 16:25:22
Keep-Alive connection feature in HTTP protocol is meant to reduce TCP connection hits to web server. It should be able to improve web server performance. However, I found that some web servers deliberately disable KeepAlive feature from server side. In my understanding, some reverse proxy, i.e. HAProxy, disables HTTP keep-alive in order to reduce memory usage which is more critical than CPU usage in some situation. Is there any other reason why Web server disables Keep-Alive? pmeenan Actually, Keep-Alive is meant to improve HTTP performance, not server performance (though for SSL connections

Ruby daemon process to keep objects alive for transient Ruby instances

白昼怎懂夜的黑 提交于 2019-12-01 14:37:24
Does Ruby offer a mechanism to share variables (more importantly, class objects and any other data abstractions I deem useful for that matter) between different running Ruby processes? For example if I have a class instantiated, initialized and carefully tuned to a certain state, I want that state to sort of globally be available to all my otherwise independent Ruby and Irb runs throughout the day, outliving the lifetime of the process that initially used it. One scenario I'm now considering to effectively address this problem is to create a micro Ruby script acting merely as a keeper of my

vue中 keep-alive 组件的作用

风格不统一 提交于 2019-12-01 09:44:13
keep-alive: 主要用于 保留组件状态 或 避免重新渲染 。 比如: 有一个 列表页面 和一个 详情页面 ,那么用户就会经常执行打开 详情=>返回列表=>打开详情 这样的话 列表 和 详情 都是一个 频率很高 的页面,那么就可以 对列表组件 使用 <keep-alive></keep-alive> 进行缓存,这样用户每次 返回列表 的时候,都能 从缓存中快速渲染 ,而 不是重新渲染 。 1、属性: include: 字符串或正则表达式。只有匹配的组件会被缓存。 exclude: 字符串或正则表达式。任何匹配的组件都不会被缓存。 2、用法: 包裹 动态组件 时,会 缓存 不活动的组件实例,而 不是销毁 它们。和 <transition> 相似, <keep-alive> 是一个抽象组件:它自身不会渲染一个 DOM 元素,也不会出现在父组件链中。 <!-- 基本 --> <keep-alive> <component :is="view"></component> </keep-alive> <!-- 多个条件判断的子组件 --> <keep-alive> <comp-a v-if="a > 1"></comp-a> <comp-b v-else></comp-b> </keep-alive> <!-- 和 `<transition>` 一起使用 --> <transition

Windows TCP socket has SO_KEEPALIVE enabled by default?

半世苍凉 提交于 2019-12-01 09:35:33
I've encountered a strange bug with TCP sockets. It seems that SO_KEEPALIVE is enabled on all sockets by default. I wrote a short test case to create a socket and connect to a server. Immediately after the connect, I check SO_KEEPALIVE with getsockopt . The value is non-zero, which according to the MSDN, means keep alive is enabled. Maybe I'm misunderstanding this. I recently had a strange bug where a server disconnected twice in a row. Some clients were in a state where they had sent logon information and were waiting for a response. Even though there was an overlapped WSARecv posted to the

How to keep an App Engine/Java app running with deaf requests from a Java/Python web cron?

烂漫一生 提交于 2019-12-01 08:21:41
App Engine allows you 30 seconds to load your application My application takes around 30 seconds - sometimes more, sometimes less. I don't know how to fix this. If the app is idle (does not receive a request for a while), it needs to be re-loaded. So, to avoid the app needing to be reloaded, I want to simulate user activity by pinging the app every so often. But there's a catch . . . If I ping the app and it has already been unloaded by App Engine, my web request will be the first request to the app and the app will try to reload. This could take longer than 30 seconds and exceed the loading