小编Gau*_*dri的帖子

stale-while-revalidate 如何与 Cache-Control 标头中的 s-maxage 交互?

只是想了解我为 SSR 页面指定的标题:public, s-maxage=3600, stale-while-revalidate=59

请注意,我的stale-while-revalidate值是 59 秒,远小于s-maxage1 小时的值。我想知道当stale-while-revalidatevalue 小于 时s-maxage,到底会发生什么?标题是否被stale-while-revalidate忽略?

caching server-side-rendering next.js

8
推荐指数
1
解决办法
3289
查看次数

Material UI 自动完成 + 无限滚动在一起?

问题:获取双滚动条 - 删除纸张滚动条会使自动完成内容不可滚动,因此仅显示下拉列表可见高度中的内容。如果我隐藏另一个滚动,则不会调用无限滚动 API。我怎样才能让它工作:

描述 -

我正在尝试使用 Material UI Autocomplete 创建一个无限滚动,我使用react-infinite-scroll-component附加链接作为参考

我的实现方式是:

因为我们需要将无限滚动附加到呈现列表项的 Popper;因此我编写了自定义 PAPER 组件(根据文档,它负责渲染下拉列表中的项目)PaperComponent={myCustomComponent}

我的 InfiniteScrollAutoComplete 定义附在下面:

<Autocomplete
      options={list.data && list.data !== null ? list.data : []}
      getOptionLabel={(option) => option.name}
      PaperComponent={(param) => (
        <InfiniteScroll
          height={200}
          dataLength={list.total}
          next={this.handleFetchNext.bind(this)}
          hasMore={list.data.length < list.total ? true : false}
          loader={
            <p style={{ textAlign: "center", backgroundColor: "#f9dc01" }}>
              <b>Loading...</b>
            </p>
          }
          endMessage={
            <p style={{ textAlign: "center", backgroundColor: "#f9dc01" }}>
              <b>Yay! You have seen it all</b>
            </p>
          }
        >
          <Paper {...param}  />
        </InfiniteScroll>
      )} …
Run Code Online (Sandbox Code Playgroud)

autocomplete infinite-scroll material-ui react-infinite-scroll-component

5
推荐指数
1
解决办法
7522
查看次数