how to served css/js files in cdn server




Wordpress LScache Plugin: how to served css/js files in cdn server

Last Updated on: Wed, 15 Apr 2026 00:00:02
Hello I use LS to combine and minify my sites css/js files. Suppose my site address is domain.com and I have a cdn.domain.com subdomain. I want my static files to be called from this subdomain but this files not exist on this server. Do we need to manually move this file to other server? Is there a way for example to transfer these static files to another server via FTP? Because after a while new static files with different names are created by the plugin. Usually, the CDN service provider will auto cache the static file when you pointing the IP to your server, which means you do not need to copy the file manually. May I know which CDN service are you using? Do you need to copy other static files manually? I use cloudflare CDN. But only my CDN address goes pass CF and my main domain does not pass CF and I want my static files to be serviced by my cdn.domain.com that pass CDN. my main domian is not on CDN Does cdn.domain.com point to the same IP as you www.domain.com(you WordPress site)? If yes you dont need to copy any files, CloudFlare will handle the file cache by their engine. The point is that the main domain cannot cross CF. (Because some IPs are blocked by ISP in Iran (And this is not a problem for subdomains). And we have to put our static files in one subdomain) However do we have to manually transfer? Why is it that every day new static files are created with different names? Our site styles and scripts will not change When the script and styles TTL expired (on LiteSpeed Cache Setting > Optimiza > CSS/JS Cache TTL) or admin purge CSS/JS cache and load the page again the file will be regenerated and then file name will be changed. You can set the TTL longer to keep the file remain unchanged, but you need to purge CSS/JS cache manually if you have any change. Our minify and combine file will always on the same folder, you can set up a server script for copying the file to your CDN server.



LiteCache Rush: Speed comes from using less, not from doing it faster



Reference