简体   繁体   English

您如何在Rikulo Stream服务器中取消缓存主页?

[英]How do you uncache the home page in Rikulo Stream server?

Could you tell me how can I uncache the default home page in Rikulo Stream? 您能告诉我如何在Rikulo Stream中取消缓存默认主页吗? By home page I mean the main domain (xxx.xxx.com) with no sub path (/xxx), not even including '/'. 主页是指没有子路径(/ xxx)的主域(xxx.xxx.com),甚至不包含'/'。 The urimapping setting doesn't allow me to set a filter for a path that not start with '/', '.', '[' or '(' and (.*) is not working for me, (cache-control is still set to max-age=2592000 for the default home page). urimapping设置不允许我为不以'/','。','['或'('和(。*)开头的路径设置过滤器,但不适用于我((cache-control is仍将默认首页设置为max-age = 2592000)。

Is it a static page (eg, index.html) or a RSP page? 它是静态页面(例如index.html)还是RSP页面?

If it is RSP, you can specify the header(s) you like. 如果是RSP,则可以指定所需的标头。 For example, 例如,

[:header
  Cache-Control="no-cache, must-revalidate, no-store, private, max-stale=0, max-age=0, post-check=0, pre-check=0"
  Expires="0" Pragma="no-cache"]

If it is static, there is no direct way to override max-age, ETAG, and related headers. 如果它是静态的,则没有直接的方法来覆盖最大寿命,ETAG和相关标头。 But, there is a few alternatives. 但是,有几种选择。 First, you can implement your own resource loader ). 首先,您可以实现自己的资源加载器 )。

Second, you implement a handler to set the header and include the real page. 其次,您实现一个处理程序来设置标题并包括真实页面。 Assume you mapped HTML files under /s: 假设您将HTML文件映射到/ s下:

uriMapping: {
  r"/s/.*\.html": (HttpConnect connect) {
    connect.response.headers..contentType = "text/html"
      ..add("Cache-Control", "no-cache"); //also other headers
    return connect.include(connect.request.uri.path.substring(2));
  }
  • If a page is included, it won't update the headers. 如果包含页面,则不会更新页眉。

Of course, you can implement your HTML file in RSP. 当然,您可以在RSP中实现HTML文件。 Then, you got the total control. 然后,您获得了全部控制权。 Plus, you can use the script tag to generate a proper link easily (which includes a simple version control). 另外,您可以使用script标记轻松生成正确的链接(其中包括简单的版本控制)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM