Comments (6)
控制台的错误请忽略
from twikoo.
js顺序的问题,twikoo要放在chunk之前加载
from twikoo.
@imaegoo 感谢回复 研究了一下 或许和js顺序有关。我用了其它方式解决,并且我有一些不太理解
关于 CDN 镜像
https://lib.baomitu.com/twikoo/1.6.29/twikoo.all.min.js 404 为啥404?
https://cdn.staticfile.org/twikoo/1.6.29/twikoo.all.min.js Cache-Control: max-age=2 为啥只给2秒?
我开始出问题是用的https://cdn.staticfile.org/twikoo/1.6.29/twikoo.all.min.js
原因也出在Cache-Control: max-age=2
切换到https://cdn.bootcdn.net/ajax/libs/twikoo/1.6.29/twikoo.all.min.js Cache-Control: max-age=31536000
就完全正常了 之前是两秒过期 现在缓存时间长了到没问题了
希望作者能把baomitu这个恢复一下 现在404用不了 这个国内外速度都挺快
from twikoo.
我用了其它方式解决,并且我有一些不太理解
和 js 的加载顺序有关,和缓存无关,Cache-Control 不能解决根本问题,建议调整 js 的加载顺序,确保“声明”在“调用”之前执行。
<!-- 声明 -->
<div id="tcomment"></div>
<script src="https://cdn.staticfile.org/twikoo/1.6.29/twikoo.all.min.js"></script>
<!-- 调用 -->
<script>
twikoo.init({ ... })
</script>
声明必须在调用之前,之所以缓存之后没有出现问题,是因为<script defer ...>
无法保证js的执行先后顺序,被缓存的twikoo js文件恰巧先于网站js执行了,造成了“缓存以后就正常了”的现象。
为啥404?
其中一些 CDN 可能需要数天时间同步最新版本
希望作者能把baomitu这个恢复一下 现在404用不了 这个国内外速度都挺快
CDN 并不是 twikoo 作者维护的,baomitu 由 360 维护,CDN 厂商会定时同步最新版本的 js
from twikoo.
好的。🙏thanks
from twikoo.
cdn.staticfile.org / cdn.staticfile.net / lib.baomitu.com 替换成 -> s4.zstatic.net/ajax/libs,有 CDN 加载快,同步也很及时
from twikoo.
Related Issues (20)
- [控制台警告] Password field is not contained in a form HOT 1
- commentText 返回数据优化 HOT 2
- 置顶评论后会新生成一条相同评论,取消置顶后重复评论还在,如何解决? HOT 8
- 如何在 vitepress 引入twikoo? HOT 1
- 邮件测试正常 但是游客留言 邮件不通知.
- 安装报错
- 换了 outlook、AOL、qq 邮箱全都无法发不了测试邮件。。。请问一般用什么邮箱比较能容易成功 HOT 2
- SMTP邮箱配置问题
- 前端更新,前端的cdn版本在哪里找? HOT 2
- 如何切換深色模式和明亮模式 HOT 1
- qmsg消息违规:评论人的邮箱地址违规
- 用户输入网址不显示 HOT 4
- markdown编辑
- markdown预览 HOT 2
- [建议] Gravatar 头像使用 SHA256 哈希
- docker部署访问量无法导入 HOT 5
- 适配hexo的Chic主题
- 评论预览和实际发送样式差异 HOT 1
- 添加评论限高选项 HOT 4
- docker版本总是提示更新
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twikoo.