通过CDN使用回发 [英] Using Postbacks with a CDN

查看:81
本文介绍了通过CDN使用回发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个基于Sitecore / Webforms的网站,我们希望在Akamai CDN之后运行,但是回发时ViewView MAC验证存在问题。

We have a Sitecore/Webforms based website that we'd like to run behind Akamai CDN however we're having an issue with ViewState MAC validation on our postbacks.

我们已经针对网站上的大多数核心表单解决了这一问题(通过将其从CDN缓存中删除并直接为每个用户提供),但是在每个页面的页脚中都保留了一个简单表单将邮件发回到服务器上。

We've worked around this for most of the core forms on the site (by taking them out of the CDN cache and serving them direct for every user), but we're left with a simple form in the footer of every page that posts back to the server.

当前,我们看到错误:

Validation of viewstate MAC failed.

我相信这是CDN将原始请求中的viewstate字段以及这些内容缓存的原因造成的与其他用户不匹配。

I believe this is caused by the CDN caching the viewstate fields from the original request and these (obviously) not matching for other users.

由于我们在多个服务器上运行此站点,因此我们已经正确拥有了机器密钥在添加Akamai之前进行配置(我们已经能够使用postBackUrl设置将其发布回其他页面/ SSL实例/等)。

As we are running this site on multiple servers, we already have the machinekey correctly configured (we've been able to use postBackUrl settings to post back to other pages/SSL instances/etc.) before we added Akamai.

在运行Asp时.NET 4.5.2,即使我们认为这是一个好主意,也无法尝试禁用viewstate MAC。

As we're running Asp.NET 4.5.2 there's no way we can even attempt to disable viewstate MAC even if we thought it was a good idea.

设置 ViewStateMode =禁用仍然会给我们提供一个很小的视图状态(大概是MAC),这仍然会导致问题。

Setting ViewStateMode=Disabled still leaves us with a tiny viewstate (presumably the MAC) which still causes problems.

无论如何,我们可以从中删除会话依赖性

Is there anyway we can remove the session dependence from the viewstate?

我们可以用来复制此内容的基本步骤:

The basic steps we can use to replicate this:


  1. 从浏览器A请求页面-Akamai缓存页面。

  2. 从浏览器A提交表单-成功!

  3. 从浏览器B请求页面-Akamai提供缓存的页面。

  4. 从浏览器B提交表单-错误!

  1. Request page from Browser A - Akamai caches page.
  2. Submit form from Browser A - Success!
  3. Request page from Browser B - Akamai serves cached page.
  4. Submit form from Browser B - ERROR!


推荐答案

不,Akamai CDN从不缓存POST请求。但是尝试添加表单以不缓存列表并尝试复制问题是个好主意。

Nope, Akamai CDN never caches POST requests. But its good idea to try adding the forms to do not cache list and try replicate the issue.

这篇关于通过CDN使用回发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆