1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-24 08:37:13 +00:00

Speed up PV display.

This commit is contained in:
Cotes Chung
2020-05-12 02:16:36 +08:00
parent 0f5c2b5c9d
commit 8db0e2d238
2 changed files with 3 additions and 2 deletions

View File

@@ -184,12 +184,12 @@ $(function() {
if ($('.pageviews').length > 0) {
let originPvData = pageviews ? JSON.parse(pageviews) : undefined;
let cache = PvCache.getData();
if (cache) {
if (PvCache.isExpired()) {
if (PvCache.isProxyCache() ) {
let originPvData = pageviews ? JSON.parse(pageviews) : undefined;
if (originPvData) {
if (PvCache.newerThan(originPvData)) {
displayPageviews(cache);
@@ -215,6 +215,7 @@ $(function() {
}
} else {
let originPvData = pageviews ? JSON.parse(pageviews) : undefined;
fetchOriginPageviews(originPvData);
fetchProxyPageviews();
}