kokororin / pixiv.moe

😘 A pinterest-style layout site, shows illusts on pixiv.net order by popularity.
http://qiita.com/kokororin/items/5c065fb48dcbf61edc6d
MIT License
361 stars 50 forks source link

HTML and Service Worker does not contain same content #22

Closed simon300000 closed 5 years ago

simon300000 commented 5 years ago

Output of curl https://pixiv.moe/ andcurl https://pixiv.moe/index.html:

➜ ~ curl https://pixiv.moe/ <!doctype html>pixivギャラリー

Javascriptが無効になっていると、サイト内の一部機能がご利用いただけません

(・ω・)

%

➜ ~ curl https://pixiv.moe/index.html <!doctype html>pixivギャラリー

Javascriptが無効になっていると、サイト内の一部機能がご利用いただけません

(・ω・)

%

➜ ~

Original content of the issue: Failed to load resource: the server responded with a status of 404 ()

https://pixiv.moe/app.7de0217557d90c88c572.js

kirainmoe commented 5 years ago

It works for me. Probably index.html has been cached by your browser, try to clear caches.

simon300000 commented 5 years ago

This is so weird. Safari got file that indicate app.7de0217557d90c88c572.js I cleared the cache of Safari before.

I use curl https://pixiv.moe/ and got app.7de0217557d90c88c572.js

But Chrome works...

I have no idea why.

I also tried site sucker

2018/10/16, 9:16:49 AM - ERROR: Download of "https://pixiv.moe/app.7de0217557d90c88c572.js",
    referenced from "/Users/simon3000/Downloads/us.sitesucker.mac.sitesucker/pixiv.moe/index.html",
    failed with error code 404 (not found)

---------------------
kirainmoe commented 5 years ago

The original index.html is loading app.7de0217557d90c88c572.js, but this site is using Service Worker feature which will register an service worker when first visit and cache the true index.html, which is loading app.885ee479c0bd3f6993ab.js. Safari 12- does not support service worker, so you will see Chrome works(after the second refresh), but Safari not. Will look into this issue.

kokororin commented 5 years ago

Latest js file is /app.885ee479c0bd3f6993ab.js Works on my Safari

simon300000 commented 5 years ago

Safari 12.0.1 (14606.2.104.1.1) There is some problem with my Safari, Safari does support service worker but it does not load at https://pixiv.moe for some reason. I switched to https://pixiv.moe/index.html it load the correct js.

我现在感觉我是个假的程序员

kokororin commented 5 years ago

Should be same now

simon300000 commented 5 years ago

Oh yea

simon300000 commented 5 years ago

I found that pages such as https://pixiv.moe/illust/71178164 will be 404 at Safari or curl, but good with Chrome.

The server side render will be useless...

kokororin commented 5 years ago

Forget to change the nginx config file (; ̄Д ̄) It works now (>д<)

simon300000 commented 5 years ago

Wohaha