开发者

XSLT stylesheet does not reload

Hey, I got a static page which uses an XSLT stylesheet and pulls in the overall menu from a separate menu.xml.

Usua开发者_运维技巧lly, the menu wont change, neither will the stylesheet. However, at some point they may, because the content is modified. In any case, the auxiliary styling files are not reloaded when you reload the main page.

Essentially, my question is: how do I get the browser to update the additional files when they change (I could live with it reloading it all the time, but it would be better if there was a way to have it pulled in only when it actually changes)?

I pull the stylesheet in with

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="main.xslt" type="text/xsl"?>
<foo>
  <bar />
</foo>

Edit: On a side node, if I explicitly open the stylesheet or the menu-file in the browser, an then reload the main page, it updates correctly, but obviously, that is not an option.


You might want to serve the modification time of your style files using the Last-Modified HTTP header.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜