Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's been quite a few years now, but back in the day I had success leveraging `mod_pagespeed` in Apache, to rewrite server-generated markup on the fly, and to respond to raster image requests with webp assets for browsers that supported them. For other similarly conditional responses I relied on a proper WURFL integration -- not just shallow UA-sniffing -- but IIRC mod_pagespeed handled the webp conditionality on its own. Which is to say, I think mod_pagespeed was able to generate and cache a webp version of my jpg assets, and it would simply serve them in response to requests that included the relevant value in their "Accepts" HTTP headers.

If you go that route, be aware that HTTP caching mechanics can get tricky, and some CDN service providers (deliberately and self-interestedly) violate the rfc's (eg refuse to cache anything w/ a "Vary" response header at all -- looking at you Akamai)...

In retrospect, it was great fun to effectively piece together a web performance optimization service layer to support and accelerate the heck out of a traditional 3-tier web application... but doing it all by hand, these days, might not have great ROI.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: