On Wed, May 1, 2013 at 9:48 AM, Sindhi Sindhi <sindhi....@gmail.com> wrote:
> I doubt if I can use ModPagespeedSubstitute, because > our string replacement actually uses some business logic. For ex. in > "oldString", if i find a "old" string at offset 0 i'll replace it with > I agree: that configuration-only solution I proposed wouldn't meet your needs. Before I give up on it completely, is your business logic going to always be in C++? I am just trying to avoid overconstraining the solution. For example, would Lua be a suitable vehicle for your business logic? See https://httpd.apache.org/docs/trunk/mod/mod_lua.html. I wonder if there's some way mod_lua & an enhanced mod_pagespeed could work together to provide the substitution with rich business logic. The reason I ask is that building & hacking mod_pagespeed's source for your purposes is a great way to get something working, but I don't have a great answer for how you'd maintain that over time as mod_pagespeed updates roll out. > The HTML-centric fetch of data as you mentioned suits the best for me. But > I dont want mod_pagespeed to actually modify anything in my HTML file, if > it can give me either the entire HTML file OR HTML-centric fetch of data > that will solve my problem :) > I'm not sure I understand your concern. mod_pagespeed will not change the HTML file on disk. It acts as an Apache output filter changing the bytes of HTML as they stream out. As the writer of a mod_pagespeed filter, you get to interpose C++ handlers for HTML lexical tokens (including Characters()) and mutate those tokens before they are serialized out to the next filter. Is that what you want? -Josh >