incubator-pagespeed-mod
incubator-pagespeed-mod copied to clipboard
Rewrite URLs in JSON files
we could expose a feature like this:
ModPagespeedJsonRewriteValue Image URL_S
With this specified, we would assume any JSON name/value pair with name==URL_S
would have a value that was a rewritable image. Or we could specify it
differently
ModPagespeedJsonRewritePattern Image *.jpg,*.png,**.gif
which would do something more like what you suggested.
To anyone else listening: would this be a valuable feature?
The first arg of both of these would be "Image", "Script", or "Stylesheet", but
probably "Image" would be most common.
Original issue reported on code.google.com by [email protected]
on 25 Mar 2014 at 12:56
Original comment by [email protected]
on 15 Apr 2014 at 11:54
Would be great! Missing this feature is the primary reason for using text/html
as Ajax response.
Original comment by [email protected]
on 16 Apr 2014 at 5:38
Any update on this ? that would be very interesting as more and more websites are turning into applications requesting JSON (That may eventually contains links to images).
Thank.
I don't believe we have any plans to work on this at the moment. As jmarantz originally suggested, it would absolutely need to be opt-in because re-writing URLs in JSON sounds pretty risky.
In the meantime, In-Place Resource Optimization can improve the content of links in the JSON, though you won't get the benefits that require URL re-writing:
https://developers.google.com/speed/pagespeed/module/system#ipro
Yes of course that something quite risky that should not be enabled by default. A good way should be to have some configuration parameters like restricting the JSON fields that can be rewritten and of course the path :)
I'm gonna take a look at the inplace one.
Thanks
A great concrete problem description for this plus a hacky way that may accomplish this was discussed over at https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/mod-pagespeed-discuss/6ThbvfJ4UnY/YMUCdOZJBQAJ