我可以通过配置切换.Net缓存提供程序(Can I switch out .Net cache provider through configuration)
在.Net中是否有办法切换出缓存提供程序,就像我会员资格提供者或角色提供者一样? 我想保持代码不变,但转而使用像memcached或AppFabric这样的分布式缓存。
所有我发现的是如何切换输出缓存提供程序。 这可能是必要的,但它没有解决直接从我的代码中调用Cache的问题。
我发现了很多库,他们在接口后面抽象Cache,但这意味着我必须去我的代码中的每个位置并注入新的抽象。 我也在使用PLINQO,它在内部使用Cache。
OutputCache是我唯一可以通过配置切换的东西吗?
先谢谢你。
Is there a way in .Net to switch out the Cache provider just like I would a membership provider, or role provider? I would like to keep the code untouched but switch to using a distributed cache like memcached or AppFabric.
All I am finding is how to switch out the output cache provider. This might be necessary, but it doesn't solve the issue of when Cache is called directly from within my code.
I've found many libraries and they abstract Cache behind an interface, but this would mean I have to go to every spot in my code and inject the new abstraction. Also I am using PLINQO, which internally uses Cache.
Is OutputCache the only thing I can switch out through configuration?
Thank you in advance.
原文:https://stackoverflow.com/questions/8972830
最满意答案
我们试图避免使用ctrl-n javascript钩子
算了吧。 虽然理论上你可以尝试使用Control键修饰符捕获'n'的按键事件,但是有很多其他方法可以打开一个可能更有可能被使用的新窗口或标签,你将无法使用去抓。 文件 - >新窗口/选项卡,中键单击或按住Shift键单击链接,中键单击后退/前进按钮,右键单击 - 打开新窗口,在新选项卡中打开书签,双击浏览器图标...
用户已经过身份验证,我们会大量使用会话。
这本身不应该是一个问题。 我猜你的意思是你的应用程序在会话中倾倒了不应该有的各种特定于页面的数据,现在当你打开多个窗口时,你会发现应用程序中断了吗? 好吧,怜悯和愉快的改写。
与此同时,您可以做的就是告诉用户“请不要尝试在同一个应用程序上打开两个浏览器窗口”。 有一些方法可以让你在一个页面上发现JavaScript同时注意到JavaScript在同一个域中的另一个页面上运行,通常涉及使用document.cookie作为页面间通信管道。 但那也有点脆弱。
We were trying to avoid ctrl-n javascript hooks
Forget it. Whilst you could in theory try to catch keypress events for ‘n’ with the Control key modifier, there are any number of other ways to open a new window or tab which may be more likely to be used, and you won't be able to catch. File->New Window/Tab, middle click or shift-click link, middle click back/forward buttons, right-click-open-in-new-window, open bookmark in new tab, double-click browser icon...
The user is already authenticated and we make heavy use of sessions.
That shouldn't be a problem in itself. I guess what you mean is that your application is dumping all sorts of page-specific data in the session that it shouldn't have, and now you find the application breaks when you have more than one window open on it? Well, commiserations and happy rewriting.
In the meantime about all you can do is tell the user “please don't try to open two browser windows on the same application”. There are potential ways you can make JavaScript on one page notice that JavaScript is running on another page in the same domain at the same time, generally involving using document.cookie as a inter-page communications conduit. But that's also a bit fragile.
相关问答
更多-
TCP/IP模型是一个________。[2023-05-19]
a -
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
-
所有你需要的是一个mousedown处理程序来伪造他们...... Test 这是一个现场演示它的工作。 All you nee ...
-
一旦它打开,关闭窗口(Close window as soon as it opens)[2023-03-27]
如果用javascript打开,只能关闭带有JavaScript的窗口。 否则,请尝试查看此问题: 如何关闭浏览器窗口而未收到“您要关闭此窗口”提示? You can only close windows with javascript if they were opened with javascript. Otherwise, try looking at this question: How can I close a browser window without receiving the "Do ... -
进入工具 - >选项选择Environment - > keybord,从键盘架构下拉菜单中选择“SQL Server 2000”,选择OK。 然后再次转到该选项并选择“Standard”。 你将得到Ctrl + N和F8键。 看到这篇文章: http://sqlblog.com/blogs/tibor_karaszi/archive/2008/08/26/missing-f8-or-ctrl-n-in-ssms-2008.aspx Go to Tools -> Options select Environ ...
-
我们试图避免使用ctrl-n javascript钩子 算了吧。 虽然理论上你可以尝试使用Control键修饰符捕获'n'的按键事件,但是有很多其他方法可以打开一个可能更有可能被使用的新窗口或标签,你将无法使用去抓。 文件 - >新窗口/选项卡,中键单击或按住Shift键单击链接,中键单击后退/前进按钮,右键单击 - 打开新窗口,在新选项卡中打开书签,双击浏览器图标... 用户已经过身份验证,我们会大量使用会话。 这本身不应该是一个问题。 我猜你的意思是你的应用程序在会话中倾倒了不应该有的各种特定于页面的数 ...
-
IE 7 CTRL +点击打开一个新窗口 - 如何抑制它?(IE 7 CTRL + click opens a new window - how to suppress it?)[2022-04-28]
没有办法抑制Ctrl +单击Internet Explorer中没有子元素的链接 - 如果Ctrl键被按下, onclick事件根本不会触发链接点击。 看起来微软不希望你改变这个功能,因为担心你可能会混淆用户。 在发布这个答案之前,我搜索了一些官方确认/解释,但不幸的是,这个限制没有在MSDN上的文档中列出,Google也没有帮助。 尽管如此,它仍然是真实的,请亲自尝试: Hello 你会发现按住Ctrl并点击链接不会抛出 ... -
检查event的ctrlKey , shiftKey和metaKey属性。 它们告诉您用户是分别持有控制,移位还是命令。 还要检查which不是2 ,这意味着用户中间点击了该链接。 $(".link").on("click", function(event) { if (event.ctrlKey || event.shiftKey || event.metaKey || event.which == 2) { return true; } // ... load ...
-
我的vim源代码副本(在某些时候使用Mercurial和hg clone https://vim.googlecode.com/hg/ )发现在内部函数vim_findfile_init()仅在一个点抛出错误: static char_u e_pathtoolong[] = N_("E854: path too long for completion"); ... /* * copy wc_path and add restricts to the '**' wildcard. * The oct ...