Index: /branches/release-35/lib/MT/Blog.pm
===================================================================
--- /branches/release-35/lib/MT/Blog.pm (revision 1949)
+++ /branches/release-35/lib/MT/Blog.pm (revision 1971)
@@ -385,11 +385,11 @@
     my $path = $param->{path} || '';
     my @path;
-    if ($path =~ m!^/!) {
+    if ($path =~ s!^/!!) {
         # absolute
-        @path = split /\//, $path;
+        @path = split q{/}, $path;
     } else {
         # relative
         push @path, MT->config('IncludesDir');
-        push @path, split /\//, $path;
+        push @path, split q{/}, $path;
     }
     return ($filename, @path);
Index: /branches/release-35/lib/MT/Template/ContextHandlers.pm
===================================================================
--- /branches/release-35/lib/MT/Template/ContextHandlers.pm (revision 1958)
+++ /branches/release-35/lib/MT/Template/ContextHandlers.pm (revision 1971)
@@ -2370,5 +2370,5 @@
             $use_ssi = 0;
         } else {
-            my $extra_path = $arg->{cache_key} ? $arg->{cache_key}
+            my $extra_path = ($arg->{cache_key} || $arg->{key}) ? $arg->{cache_key} || $arg->{key}
                 : $tmpl->cache_path ? $tmpl->cache_path
                     : '';
@@ -2387,9 +2387,10 @@
       && ( ( $arg->{cache} && $arg->{cache} > 0 )
         || $arg->{cache_key}
+        || $arg->{key}
         || ( exists $arg->{ttl} )
         || $tmpl->use_cache ) ? 1 : 0;
     my $cache_key =
-        $arg->{cache_key}
-      ? $arg->{cache_key}
+        ($arg->{cache_key} || $arg->{key})
+      ? $arg->{cache_key} || $arg->{key}
       : 'blog::' . $blog_id . '::template_' . $type . '::' . $tmpl_name;
     my $ttl =
Index: /branches/release-35/t/65-ssi.t
===================================================================
--- /branches/release-35/t/65-ssi.t (revision 1949)
+++ /branches/release-35/t/65-ssi.t (revision 1971)
@@ -105,2 +105,49 @@
     'test template included template by ssi');
 
+$tmpl = MT->model('template')->new;
+$tmpl->blog_id($blog->id);
+$tmpl->text(q(hi <mt:include module="Included Template" key="w" ttl="1000" ssi="1"> bye));
+
+$ctx = MT::Template::Context->new;
+$ctx->{__stash}{vars}{woot} = 'terrible';
+$out = $tmpl->build($ctx, {});
+
+ok(defined $out, 'test template built');
+$site_url = $blog->site_url;
+$site_url =~ s{ \A \w+ :// [^/]+ }{}xms;
+$site_url =~ s{ / \z }{}xms;
+like($out, qr(\Ahi <!--#include virtual="${site_url}/includes_c/w/included_template.html" --> bye\z)ms,
+    'test template included template by ssi using \'key\' with relative path');
+
+
+$tmpl = MT->model('template')->new;
+$tmpl->blog_id($blog->id);
+$tmpl->text(q(hi <mt:include module="Included Template" ttl="1000" ssi="1"> bye));
+
+$ctx = MT::Template::Context->new;
+$ctx->{__stash}{vars}{woot} = 'terrible';
+$out = $tmpl->build($ctx, {});
+
+ok(defined $out, 'test template built');
+$site_url = $blog->site_url;
+$site_url =~ s{ \A \w+ :// [^/]+ }{}xms;
+$site_url =~ s{ / \z }{}xms;
+like($out, qr(\Ahi <!--#include virtual="${site_url}/includes_c/included_template.html" --> bye\z)ms,
+    'test template included template by ssi without \'key\'');
+
+
+$tmpl = MT->model('template')->new;
+$tmpl->blog_id($blog->id);
+$tmpl->text(q(hi <mt:include module="Included Template" cache_key="/w" ttl="1000" ssi="1"> bye));
+
+$ctx = MT::Template::Context->new;
+$ctx->{__stash}{vars}{woot} = 'terrible';
+$out = $tmpl->build($ctx, {});
+
+ok(defined $out, 'test template built');
+$site_url = $blog->site_url;
+$site_url =~ s{ \A \w+ :// [^/]+ }{}xms;
+$site_url =~ s{ / \z }{}xms;
+like($out, qr(\Ahi <!--#include virtual="${site_url}/w/included_template.html" --> bye\z)ms,
+    'test template included template by ssi with \'key\' absolute path');
+
