Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

having problems with cdn push to server and urls #9

Closed
gundestrup opened this issue Feb 27, 2018 · 6 comments
Closed

having problems with cdn push to server and urls #9

gundestrup opened this issue Feb 27, 2018 · 6 comments

Comments

@gundestrup
Copy link
Contributor

gundestrup commented Feb 27, 2018

On one my my test websites
I see this

https://a2.lungekursus.dk/plugins/editors-xtd/n ... n/assets/fonts/fontawesome-webfont.woff2?v=4.7.0
https://cdn.a2.lungekursus.dk/plugins/editors-x ... n/assets/fonts/fontawesome-webfont.woff2?v=4.7.0

It basicly shows (to me), that litespeed cache, misses first time with url
https://a2.lungekursus.dk/plugins/editors-xtd/n ... n/assets/fonts/fontawesome-webfont.woff2?v=4.7.0

But now, the file is uploaded to the cdn (for the next load)
The website now wants
https://cdn.a2.lungekursus.dk/plugins/editors-x ... n/assets/fonts/fontawesome-webfont.woff2?v=4.7.0
but that is unknown to the lite speed cache...giving a miss.

ok, Now I load the website again (third time), it now responds with a "hit"
But both files are loaded?!
https://tools.pingdom.com/#!/cEwltR/https://a2.lungekursus.dk/

Should the plugin not see the cdn / cookieless resource and not trying to load both?

You can see how it's supposed to load on this
https://tools.pingdom.com/#!/dyFeTN/https://www.lungekursus.dk/

Here the cdn resource is only rested one time

@WuhuaChen
Copy link
Collaborator

I just checked and found that even without cache the problem is same. both font file been loaded is because in HTML source there are multiple reference to that font file, one is link to cdn link, others reference to local link:

format('embedded-opentype'),url(/plugins/editors-xtd/ns_fontawesome_pro_btn/assets/fonts/fontawesome-webfont.woff2?v=4.7.0) format('woff2'),url(/plugins/editors-xtd/ns_fontawesome_pro_btn/assets/fonts/fontawesome-webfont.woff?v=4.7.0) format('woff'),url(/plugins/editors-xtd/ns_fontawesome_pro_btn/assets/fonts/fontawesome-webfont.ttf?v=4.7.0) format('truetype'),url(//cdn.a2.lungekursus.dk/plugins/editors-xtd/ns_fontawesome_pro_btn/assets/fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular)

Normally, After upload a static file to CDN, you need manually press "Purge All LiteSpeed Cache" Button, because all page cache with reference to upload static file should be expired.

@gundestrup
Copy link
Contributor Author

Yes, but the way a cdn works is that when the file is asked for, the file is served by the website, and send also to the cdn
Then then the url i changed (automaticly) so the files at the next load is loaded from cdn.
It's how is works now in joomla.

So to sum it up, litespeed is not compatable with cdn in a normal joomla installation

@gundestrup
Copy link
Contributor Author

jotcache, and every other cache plugin can figure it out...

@WuhuaChen
Copy link
Collaborator

In our WordPress version cache plugin, we implemented CDN Optimize feature, before page cached, it will analyze static files included in page, and found if it already exists in CDN it will replace the file link to CDN file link.
In Joomla version we didn't implement it yet, I don't find jotcache implemented this feature. I noticed that your official site optimized with CDN very well, if it's implemented by JCH Optimizer, You can still use JCH Optimizer implement CDN optimize , All extra thing need to do is to manually "Purge All LiteSpeed Cache" after upload static file to CDN.

@gundestrup
Copy link
Contributor Author

gundestrup commented Mar 1, 2018 via email

@gundestrup
Copy link
Contributor Author

Closing the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants