Serving hard coded images via CDN

#1
Hey guys,

I recently signed up for "WP Compress" who optimise and serve my images. I also, of course, use LiteSpeed as a cache. Both work together more or less perfectly by default. However with one problem...

My background images are hardcoded into the HTML and CSS. Now Litespeed obviously caches this HTML and that means my WP Compress cannot access that image to serve it as it cannot alter the HTML that LS serves up.

Hopefully, I explained that well enough, I don't fully understand it myself so forgive me if it doesn't make much sense. In the words of the Wp Compress dev, which may make more sense, his plugin doesn't serve the background images on my site because " LS delivers cached HTML and our plugin does not do a search & replace for that."

Anyway, my question, is there a way to counteract this? Perhaps a way to force LS to rewrite background images or something... god I don't even know what I am suggesting, but hopefully one of you guys can help anyway :)

Cheers
 

serpent_driver

Well-Known Member
#2
You must say "Goodbye" to WP Compress. If a page is cached there is no way to execute PHP, because a cached page is pure HTML, so WP Compress can't do its job, but don't worry. LiteSpeed Cache plugin for Wordpress has all you need to the same like WP Compress.
 

winkybil

Active Member
#3
What services do you guys use to host and serve images on your application/website? I am working on an application where I want to provide users the option to upload a profile picture. I am currently thinking of using AWS S3 bucket with AWS cloudfront as a CDN. I was thinking if there was any other service I could use as my current approach might be a bit of overkill(?).





snaptube vidmate word to pdf
 
Last edited:
Top