Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm currently connecting to a server via SFTP so I can edit the files locally and have them uploaded back to the server every time I change / update a file. Well, I'm sick of having to refresh the browser window every time to see these changes.

Are there any apps that will auto refresh for me? I tried LiveReload, but thats only for local files not SFTP.

share|improve this question

migrated from stackoverflow.com Dec 13 '12 at 11:41

This question came from our site for professional and enthusiast programmers.

    
I imagine you might be able to do this with WinSCP using a command. –  Jared Farrish Dec 13 '12 at 8:16
1  
Is pressing F5 really that much effort? You could have refreshed your page 355 times instead of making this post! ;) But seriously, here are some options: net.tutsplus.com/tutorials/other/… (Also, is there a reason you can't work in localhost while developing?) –  Alan Shortis Dec 13 '12 at 8:19
    
You could also run a script on the server to implement a web socket (in a browser that supports web sockets, like Chrome or Firefox) and setup a socket interface in Chrome for instance to listen for your SFTP client to notify a file was touched and broadcast back to your page(s) to refresh. Seems roundabout, but it makes sense to me. –  Jared Farrish Dec 13 '12 at 8:37
add comment

4 Answers

In LiveReload there is an option to "Override URLs to serve modified CSS from localhost". It's under the first options box. It will reload the page when making changes to local files but I've noticed that it has some issues with images not showing up on reload.

share|improve this answer
    
livereload.com –  Jared Farrish Dec 14 '12 at 9:05
add comment

You could use the old method of using a meta refresh tag:

<meta http-equiv="refresh" content="600">

This tells the browser to refresh the page every 600 seconds.

Make sure you remove it before pushing your site to it's production environment, nobody likes a surprize refresh ;)

share|improve this answer
    
Ya, I can't do that since its a live site, but thanks. –  Nick Dec 13 '12 at 8:18
    
Aha, well then I don't know of any other resources :) Good luck! –  Kyle Sevenoaks Dec 13 '12 at 8:19
    
Good answer, but I tried in my browser it's 600 seconds but not 600 miliseconds –  Teddy Dec 13 '12 at 8:22
    
Oops, I'll change that, thanks for the heads up :) –  Kyle Sevenoaks Dec 13 '12 at 8:22
    
I'd probably suggest some background worker script be injected if coming from an IP or some other identifier for yourself, and instead have a script do a compare of the last to current timestamp for your session. Or have the sFTP client ping a script that pushes the new timestamp for the file to an index accessible by the observing script communicating to your browser file changes. Y'know, easy stuff. –  Jared Farrish Dec 13 '12 at 8:47
add comment

In addition to Kyle's great answer:

You can use browser plugins to auto refresh pages for you, you can change the interval on the fly unlike the meta tag way of doing things which would require editing the meta tag if the refresh rate is not correct for you.

You can get a list of plugins: http://cerberusweb.com/support/kb/article/62

share|improve this answer
add comment

Another solution is to build another page to wrap your web page inside an iframe then in the outer page, use js settimeout to refresh. Thus will not impact other users.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.