Tried to use SSI (Server Side Include) to implement a dynamic concat page to  merge CSS, Javascripts files… but failed. Seemed SSI can’t do that?

What I though it could be done:

/concat.shtml?file1=filepath&file2=filepath&…

and in concat.shtml use SSI to access the Query String, and the include each file together.  Unfortunately, in SSI all I can get is a “raw” Query String “file1=filepath&file2=filepath&…”, and I checked all around and seemed no way to extract variables from  that query string.  :( I hope I was wrong…someone tell me.

Of course it can be easily done with a simple PHP, but PHP is too much for what I need(and maybe have unwanted overhead, bring in performance issue), all I need is a simple parse the query string…

Another feature I wish SSI could have is add <!– include remote=”http://blah.blah.com/blah/blah/” –>, yes it could be done together with mod_proxy by <!– include virtual=”/proxy/blah.blah.com/blah/blah/” –>.  But I wish SSI could build in such a simple but really useful feature.

Another thing that I waited for years but still no mature product is “ESI” (Edge Side Include),  I believe it could be valuable for high traffic site to improve cache hit rate.  (maybe apache SSI + mod_proxy + mod_cache can do something like ESI? maybe I can have a try…)

Popularity: 9% [?]



3 Comments to “Tired with SSI… Isn’t any better SSI replacement?”

  1. Chris | December 23rd, 2007 at 2:20 pm

    have a look at this:







    extracting values from the query string using regExp works fine for me

    cheers,
    chris

  2. Chris | December 23rd, 2007 at 2:21 pm

    !–#if expr=’$HTTP_COOKIE = /query=([^;]+)/’ –
    !–#set var=’queryval’ value=’$1′ –
    !–#elif expr=’$QUERY_STRING = /query=([^\x26]+)/’ –
    !–#set var=’queryval’ value=’$1′ –>
    !–#else –>
    !–#set var=’queryval’ value=” –
    !–#endif –
    !–#include virtual=”/cgi-bin/search_script.pl?query=$queryval” –

    your blog didnt escape the incoming html tags, so i cut them a bit now

  3. Robert | December 23rd, 2007 at 2:24 pm

    Wow, it’s a smart idea.

    Chris, thanks a lot!

Leave a Comment

Close
E-mail It
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License.