[TxMt] HTML output cache question

Thomas Aylott - subtleGradient textmate at subtleGradient.com
Wed Mar 5 23:17:57 UTC 2008


On Mar 4, 2008, at 3:32 PM, Hans-Jörg Bibiko wrote:

> Hi,
>
> I have some tiny problems with TM's HTML output window.
>
> I have a tmcommand which generates HTML code on basis on a shell  
> script. Fine, after invoking it I see my result.
> In addition I added a button called 'Refresh' to that HTML page. I  
> want to use it to start that shell script again (which writes the  
> HTML code to a file) using TextMate.system and then via JavaScript  
> 'location.href' or 'location.replace()' to refresh the HTML output  
> window.
>
> Well, this only works if I press the button at least twice or three  
> times(?).
> After pressing the refresh button I had a look at the new generated  
> html file and the content is correct, but TM'S HTML output window  
> displays still the 'old' version.
> I tried the meta tags no-cache and expire with '0'. No success. I  
> also changed the actual html code a bit to be sure that TM  
> recognizes it's a new document.
>
> Is there a built-in cache for the HTML ouptut? Or can someone advice  
> me? How can force TM to refresh the HTML output?
>
> Many thanks in advance,
>
> --Hans

I'd suggest replacing the html of the current window instead of  
changing the url.
But if you're dead set on just changing the url, add a unique get  
string to the end EG: myfile.html?342739847923 to force the caching  
system to assume it's a different file.

Replacing the html with innerHTML or something would be a lot faster  
and bugfree.

I was actually thinking of writing something that would let me do  
this, but I never got around to it.
Just making sure everything is properly escaped for javascript and  
html and the shell and then whatever script you have is enough to  
drive the lazy coders like me mad.

—Thomas Aylott – subtleGradient—


More information about the textmate mailing list