无 cookie 会话临时 Internet 文件 (asp.net)
背景: 我在公司 Intranet 上开发一个 ASP.NET Web 应用程序。 cookieless="true" 在会话配置的 web.config 中设置。 该应用程序从页面启动,可以在几种不同的模式下运行(每种模式有不同的链接)。 业务要求是可以同时运行应用程序的多个实例进行比较,因此每个浏览器生成都必须有一个新会话...无论如何...
检查我的电脑上的临时 Internet 文件文件夹,使用的每个图像在正在查看的应用程序中被多次下载,因为会话 ID 在 url 中(我假设)并且导致找不到缓存的图像。 同一图像的 Internet 地址字段的格式为 http://mywebserver/mywebapp/(S(......))/images/xxxxxxx.gif
要继续进行无 cookie 会话,是将图像等移动到网络外部目录的最佳方法应用程序位于同一(或不同)服务器上? 例如 http://mywebserver/mywebappresource/images/xxxxxxx.gif
欢迎任何建议! 谢谢你!
background:
I work on an asp.net web application that is on a company intranet. cookieless="true" is set in the web.config in the sessions configuration. The application is launched off a page and can run in several different modes (a different link for each mode). It is a business requirement that multiple instances of the application can be run at the same time for comparison and so each browser spawn must have a new session...anyway...
Checking the Temporary Internet Files folder on my pc, each image used in the application that is being viewed is downloaded multiple times because the session id is in the url (I assume) and is causing the cached image not to be found.
The Internet Address field for the same image is in the form http://mywebserver/mywebapp/(S(......))/images/xxxxxxx.gif
To continue having cookieless sessions, is the best way to move images etc into a directory outside of the web application on the same (or different) server? e.g. http://mywebserver/mywebappresource/images/xxxxxxx.gif
any suggesions most welcome! thanks heaps!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么 gif 的 URL 需要更改,只是因为它嵌入的页面发生了变化? 如果您可以保持 gif URL 不变,那么它就会如您所愿地被缓存。
这与您的建议几乎相同,即将图像目录更改为 Web 应用程序之外。 如果在应用程序中执行此操作太尴尬,您始终可以在 Web 服务器中使用重定向规则来执行此操作。
我想我想说的是“是”。
Why does the URL for the gif need to change just because the page that it's embedded into changes? If you could keep the gif URL constant then it would be cached as you hope.
That is pretty much the same thing as what you are suggesting, with changing the directory for the images to outside the web application. You could always do this with a redirection rule within the web server if it was too awkward to do within the application.
I think what I'm trying to say is "Yes".