我有一个很大的 JSON blob,我想预先加载我的网页。为此,我已添加<link rel="preload" as="fetch" href="/blob.json">
到我的页面。我也有一个 JS 请求来获取相同的 blob。
这不起作用,控制台报告:
[警告] 资源 blob.json 是使用链接预加载预加载的,但在窗口加载事件的几秒钟内未使用。请确保它不是无故预加载的。
MDN 声称这可以通过添加crossorigin
到链接标签来解决。AFAICT,这是不正确的,并且没有任何组合或跨域属性使其真正起作用。
使用来自开发者控制台的 copy-as-curl 命令,似乎没有链接标签和属性的组合,它们将发出与 JS 中的 fetch/XHR 调用相同的请求。
我很想在这件事上犯错。
当我尝试在Ubuntu上安装libsass到Python 3.5 virtualenv时,我得到一个关于无法构建轮子的错误,但安装似乎仍然成功.我如何a)使轮子构建成功,所以我可以缓存它为新的virtualenvs或b)让它跳过似乎失败的编译东西?
这是问题的再现示例:
(libsass_test)$ pip install libsass
Collecting libsass
Using cached libsass-0.9.3.tar.gz
Collecting six (from libsass)
Using cached six-1.10.0-py2.py3-none-any.whl
Building wheels for collected packages: libsass
Running setup.py bdist_wheel for libsass
Complete output from command /home/cjohnson/libsass_test/bin/python3.5 -c "import setuptools;__file__='/tmp/pip-build-k8_g3p3v/libsass/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmp4q_j26e6pip-wheel-:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.5
copying sass.py -> build/lib.linux-x86_64-3.5
copying sassc.py -> build/lib.linux-x86_64-3.5
copying sasstests.py -> build/lib.linux-x86_64-3.5
creating build/lib.linux-x86_64-3.5/sassutils
copying sassutils/distutils.py -> build/lib.linux-x86_64-3.5/sassutils
copying sassutils/__init__.py -> build/lib.linux-x86_64-3.5/sassutils
copying sassutils/builder.py -> …
Run Code Online (Sandbox Code Playgroud)