Tired with SSI… Isn’t any better SSI replacement?
HTTP, Web July 17th, 2007
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% [?]
About
have a look at this:
extracting values from the query string using regExp works fine for me
cheers,
chris
!–#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
Wow, it’s a smart idea.
Chris, thanks a lot!