PDA

View Full Version : Improved PSP remote and Slimserver on port 80



bergek
2006-11-23, 05:30
I have had my TP and SB for a few weeks now and I am thoroughly happy. I was particularily impressed by the fact that SD managed to deliver a Transporter on my doorstep in Sweden in just three days. Kudos!

However, I have had two issues:

1) I want to run Slimserver on port 80 on a Linux box (without having to run it as root)
2) When using a PSP as remote I notice that the PSP caches web pages more than other browsers which means that the web browser in the PSP frequently does not communicate with the server which means that nothing happens. For example, when switching volume back and forth between two levels using a PSP, the volume will not change the third time since that URL is by then cached by the PSP.

I found a solution to both of these issues and I am posting this to possibly help others with the same problems.

In essence I set up a virtual site using Apache on my Slimserver (running on Ubuntu 6.06 Server). This site contains no data but only acts as a reverse proxy for the normal Slimserver web site running on port 9000. In addition I added a new DNS entry for 'music' on my home network and point that record to the IP of my Slimserver. The VirtualHost section contains the following lines:

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ProxyPass / http://localhost:9000/
ProxyPassReverse / http://localhost:9000/

This solved my first issue. I have not noticed any performance issue by routing all Slimserver HTTP traffic through Apache.

Regarding the second issue Slimserver uses HTTP/1.0 and the headers sent from Slimserver contain no information on how data should be cached. RFC1945, which specifies the HTTP/1.0 protocol, does not clearly specify how clients should cache data in this case. Thus, PSP may not be less correct than IE (which does not exhibit the same problem). It would be better if Slimserver used HTTP/1.1 and explicitly stated how data should be cached.

The solution to the problem was to enable the mod_headers module and add a Cache-Control header line by adding the following in the VirtualHost section (in my case directly below the lines above):

Header set Cache-Control "no-cache"

Of course, the protocol is now non-compliant (since Cache-Control is a HTTP/1.1 parameter) but at least it works and I am happy. This change also means that images (CD covers etc.) will have to be refetched every time but I can't say I have noticed too much of a performance hit. If it proves to be a problem it should be possible to only add the Cache-Control line for HTML files.

oreillymj
2006-11-23, 11:16
I believe you can disable browser caching in 1.0 clients using Meta tags.

Specifically <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">


http://www.i18nguy.com/markup/metatags.html