couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randall Leeds <randall.le...@gmail.com>
Subject Re: [2/2] git commit: remove version number from futon static resources
Date Wed, 09 Nov 2011 18:56:03 GMT
On Wed, Nov 9, 2011 at 02:34, Benoit Chesneau <bchesneau@gmail.com> wrote:
> On Wed, Nov 9, 2011 at 11:29 AM,  <randall@apache.org> wrote:
>> remove version number from futon static resources
>>
>> No process was in place to update these query strings, which would
>> typically serve to prevent excessive browser caching if they were
>> made to change. No one wants to change these every release. Templating
>> every single HTML file here feels silly. I'm just nuking this junk.
>>
>> Fix COUCHDB-860
>>
>>
>> Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
>> Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/7bc22f91
>> Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/7bc22f91
>> Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/7bc22f91
>>
>> Branch: refs/heads/master
>> Commit: 7bc22f91ddcbd74945c314ccb14328f07266d292
>> Parents: 7e3c69b
>> Author: Randall Leeds <randall@apache.org>
>> Authored: Thu Oct 20 14:54:08 2011 -0700
>> Committer: Randall Leeds <randall@apache.org>
>> Committed: Wed Nov 9 02:10:07 2011 -0800
>>
>> ----------------------------------------------------------------------
>>  share/www/config.html         |   10 +++++-----
>>  share/www/couch_tests.html    |   12 ++++++------
>>  share/www/custom_test.html    |   14 +++++++-------
>>  share/www/database.html       |   18 +++++++++---------
>>  share/www/document.html       |   18 +++++++++---------
>>  share/www/index.html          |   12 ++++++------
>>  share/www/replicator.html     |    8 ++++----
>>  share/www/session.html        |   12 ++++++------
>>  share/www/status.html         |    8 ++++----
>>  share/www/verify_install.html |   12 ++++++------
>>  10 files changed, 62 insertions(+), 62 deletions(-)
>> ----------------------------------------------------------------------
>>
>>
>> http://git-wip-us.apache.org/repos/asf/couchdb/blob/7bc22f91/share/www/config.html
>> ----------------------------------------------------------------------
>> diff --git a/share/www/config.html b/share/www/config.html
>> index 6771062..cfb1a5b 100644
>> --- a/share/www/config.html
>> +++ b/share/www/config.html
>> @@ -20,11 +20,11 @@ specific language governing permissions and limitations under
the License.
>>     <link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
>>     <script src="script/json2.js"></script>
>>     <script src="script/sha1.js"></script>
>> -    <script src="script/jquery.js?1.6.2"></script>
>> -    <script src="script/jquery.couch.js?0.11.0"></script>
>> -    <script src="script/jquery.dialog.js?0.11.0"></script>
>> -    <script src="script/futon.js?0.11.0"></script>
>> -    <script src="script/jquery.editinline.js?0.11.0"></script>
>> +    <script src="script/jquery.js"></script>
>> +    <script src="script/jquery.couch.js"></script>
>> +    <script src="script/jquery.dialog.js"></script>
>> +    <script src="script/futon.js"></script>
>> +    <script src="script/jquery.editinline.js"></script>
>>     <script>
>>       $(function() {
>>         $.couch.config({
>>
>> http://git-wip-us.apache.org/repos/asf/couchdb/blob/7bc22f91/share/www/couch_tests.html
>> ----------------------------------------------------------------------
>> diff --git a/share/www/couch_tests.html b/share/www/couch_tests.html
>> index 31a1ce4..8f47ce3 100644
>> --- a/share/www/couch_tests.html
>> +++ b/share/www/couch_tests.html
>> @@ -20,12 +20,12 @@ specific language governing permissions and limitations under
the License.
>>     <link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
>>     <script src="script/json2.js"></script>
>>     <script src="script/sha1.js"></script>
>> -    <script src="script/jquery.js?1.6.2"></script>
>> -    <script src="script/jquery.couch.js?0.11.0"></script>
>> -    <script src="script/jquery.dialog.js?0.11.0"></script>
>> -    <script src="script/futon.js?0.11.0"></script>
>> -    <script src="script/couch.js?0.11.0"></script>
>> -    <script src="script/couch_test_runner.js?0.11.0"></script>
>> +    <script src="script/jquery.js"></script>
>> +    <script src="script/jquery.couch.js"></script>
>> +    <script src="script/jquery.dialog.js"></script>
>> +    <script src="script/futon.js"></script>
>> +    <script src="script/couch.js"></script>
>> +    <script src="script/couch_test_runner.js"></script>
>>     <script>
>>       $(function() {
>>         updateTestsListing();
>>
>> http://git-wip-us.apache.org/repos/asf/couchdb/blob/7bc22f91/share/www/custom_test.html
>> ----------------------------------------------------------------------
>> diff --git a/share/www/custom_test.html b/share/www/custom_test.html
>> index 5401b13..155b185 100644
>> --- a/share/www/custom_test.html
>> +++ b/share/www/custom_test.html
>> @@ -20,13 +20,13 @@ specific language governing permissions and limitations under
the License.
>>     <link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
>>     <script src="script/json2.js"></script>
>>     <script src="script/sha1.js"></script>
>> -    <script src="script/jquery.js?1.6.2"></script>
>> -    <script src="script/jquery.couch.js?0.11.0"></script>
>> -    <script src="script/jquery.dialog.js?0.11.0"></script>
>> -    <script src="script/futon.js?0.11.0"></script>
>> -    <script src="script/jquery.resizer.js?0.11.0"></script>
>> -    <script src="script/couch.js?0.11.0"></script>
>> -    <script src="script/couch_test_runner.js?0.11.0"></script>
>> +    <script src="script/jquery.js"></script>
>> +    <script src="script/jquery.couch.js"></script>
>> +    <script src="script/jquery.dialog.js"></script>
>> +    <script src="script/futon.js"></script>
>> +    <script src="script/jquery.resizer.js"></script>
>> +    <script src="script/couch.js"></script>
>> +    <script src="script/couch_test_runner.js"></script>
>>     <script src="script/couch_tests.js"></script>
>>     <script>
>>       function T(arg, desc) {
>>
>> http://git-wip-us.apache.org/repos/asf/couchdb/blob/7bc22f91/share/www/database.html
>> ----------------------------------------------------------------------
>> diff --git a/share/www/database.html b/share/www/database.html
>> index 7a3294f..23945cb 100644
>> --- a/share/www/database.html
>> +++ b/share/www/database.html
>> @@ -17,17 +17,17 @@ specific language governing permissions and limitations under
the License.
>>   <head>
>>     <title>Browse Database</title>
>>     <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
>> -    <link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
>> +    <link rel="stylesheet" href="style/layout.css" type="text/css">
>>     <script src="script/json2.js"></script>
>>     <script src="script/sha1.js"></script>
>> -    <script src="script/jquery.js?1.6.2"></script>
>> -    <script src="script/jquery.couch.js?0.11.0"></script>
>> -    <script src="script/jquery.dialog.js?0.11.0"></script>
>> -    <script src="script/futon.js?0.11.0"></script>
>> -    <script src="script/jquery.resizer.js?0.11.0"></script>
>> -    <script src="script/jquery.suggest.js?0.11.0"></script>
>> -    <script src="script/futon.browse.js?0.11.0"></script>
>> -    <script src="script/futon.format.js?0.11.0"></script>
>> +    <script src="script/jquery.js"></script>
>> +    <script src="script/jquery.couch.js"></script>
>> +    <script src="script/jquery.dialog.js"></script>
>> +    <script src="script/futon.js"></script>
>> +    <script src="script/jquery.resizer.js"></script>
>> +    <script src="script/jquery.suggest.js"></script>
>> +    <script src="script/futon.browse.js"></script>
>> +    <script src="script/futon.format.js"></script>
>>     <script>
>>       var page = new $.futon.CouchDatabasePage();
>>       $.futon.navigation.ready(function() {
>>
>> http://git-wip-us.apache.org/repos/asf/couchdb/blob/7bc22f91/share/www/document.html
>> ----------------------------------------------------------------------
>> diff --git a/share/www/document.html b/share/www/document.html
>> index d29a77e..e041cd9 100644
>> --- a/share/www/document.html
>> +++ b/share/www/document.html
>> @@ -21,15 +21,15 @@ specific language governing permissions and limitations under
the License.
>>     <script src="script/json2.js"></script>
>>     <script src="script/sha1.js"></script>
>>     <script src="script/base64.js"></script>
>> -    <script src="script/jquery.js?1.6.2"></script>
>> -    <script src="script/jquery.couch.js?0.11.0"></script>
>> -    <script src="script/jquery.dialog.js?0.11.0"></script>
>> -    <script src="script/futon.js?0.11.0"></script>
>> -    <script src="script/jquery.resizer.js?0.11.0"></script>
>> -    <script src="script/futon.browse.js?0.11.0"></script>
>> -    <script src="script/futon.format.js?0.11.0"></script>
>> -    <script src="script/jquery.editinline.js?0.11.0"></script>
>> -    <script src="script/jquery.form.js?2.36"></script>
>> +    <script src="script/jquery.js"></script>
>> +    <script src="script/jquery.couch.js"></script>
>> +    <script src="script/jquery.dialog.js"></script>
>> +    <script src="script/futon.js"></script>
>> +    <script src="script/jquery.resizer.js"></script>
>> +    <script src="script/futon.browse.js"></script>
>> +    <script src="script/futon.format.js"></script>
>> +    <script src="script/jquery.editinline.js"></script>
>> +    <script src="script/jquery.form.js"></script>
>>     <script>
>>       var page = new $.futon.CouchDocumentPage();
>>
>>
>> http://git-wip-us.apache.org/repos/asf/couchdb/blob/7bc22f91/share/www/index.html
>> ----------------------------------------------------------------------
>> diff --git a/share/www/index.html b/share/www/index.html
>> index 9761ba7..ecbe8dd 100644
>> --- a/share/www/index.html
>> +++ b/share/www/index.html
>> @@ -20,12 +20,12 @@ specific language governing permissions and limitations under
the License.
>>     <link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
>>     <script src="script/json2.js"></script>
>>     <script src="script/sha1.js"></script>
>> -    <script src="script/jquery.js?1.6.2"></script>
>> -    <script src="script/jquery.couch.js?0.11.0"></script>
>> -    <script src="script/jquery.dialog.js?0.11.0"></script>
>> -    <script src="script/futon.js?0.11.0"></script>
>> -    <script src="script/futon.browse.js?0.11.0"></script>
>> -    <script src="script/futon.format.js?0.11.0"></script>
>> +    <script src="script/jquery.js"></script>
>> +    <script src="script/jquery.couch.js"></script>
>> +    <script src="script/jquery.dialog.js"></script>
>> +    <script src="script/futon.js"></script>
>> +    <script src="script/futon.browse.js"></script>
>> +    <script src="script/futon.format.js"></script>
>>     <script>
>>       var page = new $.futon.CouchIndexPage();
>>       $(document).ready(function() {
>>
>> http://git-wip-us.apache.org/repos/asf/couchdb/blob/7bc22f91/share/www/replicator.html
>> ----------------------------------------------------------------------
>> diff --git a/share/www/replicator.html b/share/www/replicator.html
>> index 2a8c9ff..eb6ecc0 100644
>> --- a/share/www/replicator.html
>> +++ b/share/www/replicator.html
>> @@ -21,10 +21,10 @@ specific language governing permissions and limitations under
the License.
>>     <link rel="stylesheet" href="style/jquery-ui-1.8.11.custom.css" type="text/css">
>>     <script src="script/json2.js"></script>
>>     <script src="script/sha1.js"></script>
>> -    <script src="script/jquery.js?1.6.2"></script>
>> -    <script src="script/jquery.couch.js?0.11.0"></script>
>> -    <script src="script/jquery.dialog.js?0.11.0"></script>
>> -    <script src="script/futon.js?0.11.0"></script>
>> +    <script src="script/jquery.js"></script>
>> +    <script src="script/jquery.couch.js"></script>
>> +    <script src="script/jquery.dialog.js"></script>
>> +    <script src="script/futon.js"></script>
>>     <script src="script/jquery-ui-1.8.11.custom.min.js"></script>
>>     <script>
>>       $(document).ready(function() {
>>
>> http://git-wip-us.apache.org/repos/asf/couchdb/blob/7bc22f91/share/www/session.html
>> ----------------------------------------------------------------------
>> diff --git a/share/www/session.html b/share/www/session.html
>> index c0cbeb5..922f738 100644
>> --- a/share/www/session.html
>> +++ b/share/www/session.html
>> @@ -20,12 +20,12 @@ specific language governing permissions and limitations under
the License.
>>     <link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
>>     <script src="script/json2.js"></script>
>>     <script src="script/sha1.js"></script>
>> -    <script src="script/jquery.js?1.6.2"></script>
>> -    <script src="script/jquery.couch.js?0.11.0"></script>
>> -    <script src="script/jquery.dialog.js?0.11.0"></script>
>> -    <script src="script/futon.js?0.11.0"></script>
>> -    <script src="script/futon.browse.js?0.11.0"></script>
>> -    <script src="script/futon.format.js?0.11.0"></script>
>> +    <script src="script/jquery.js"></script>
>> +    <script src="script/jquery.couch.js"></script>
>> +    <script src="script/jquery.dialog.js"></script>
>> +    <script src="script/futon.js"></script>
>> +    <script src="script/futon.browse.js"></script>
>> +    <script src="script/futon.format.js"></script>
>>     <script>
>>       $(function() {
>>         var ret, reason, q = window.location.search, qps = q.split("&");
>>
>> http://git-wip-us.apache.org/repos/asf/couchdb/blob/7bc22f91/share/www/status.html
>> ----------------------------------------------------------------------
>> diff --git a/share/www/status.html b/share/www/status.html
>> index d77c4cb..df35b61 100644
>> --- a/share/www/status.html
>> +++ b/share/www/status.html
>> @@ -20,10 +20,10 @@ specific language governing permissions and limitations under
the License.
>>     <link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
>>     <script src="script/json2.js"></script>
>>     <script src="script/sha1.js"></script>
>> -    <script src="script/jquery.js?1.6.2"></script>
>> -    <script src="script/jquery.couch.js?0.11.0"></script>
>> -    <script src="script/jquery.dialog.js?0.11.0"></script>
>> -    <script src="script/futon.js?0.11.0"></script>
>> +    <script src="script/jquery.js"></script>
>> +    <script src="script/jquery.couch.js"></script>
>> +    <script src="script/jquery.dialog.js"></script>
>> +    <script src="script/futon.js"></script>
>>   </head>
>>   <body><div id="wrap">
>>     <h1>
>>
>> http://git-wip-us.apache.org/repos/asf/couchdb/blob/7bc22f91/share/www/verify_install.html
>> ----------------------------------------------------------------------
>> diff --git a/share/www/verify_install.html b/share/www/verify_install.html
>> index cb8b2ed..1806adf 100644
>> --- a/share/www/verify_install.html
>> +++ b/share/www/verify_install.html
>> @@ -20,12 +20,12 @@ specific language governing permissions and limitations under
the License.
>>     <link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
>>     <script src="script/json2.js"></script>
>>     <script src="script/sha1.js"></script>
>> -    <script src="script/jquery.js?1.6.2"></script>
>> -    <script src="script/jquery.couch.js?0.11.0"></script>
>> -    <script src="script/jquery.dialog.js?0.11.0"></script>
>> -    <script src="script/futon.js?0.11.0"></script>
>> -    <script src="script/couch.js?0.11.0"></script>
>> -    <script src="script/couch_test_runner.js?0.11.0"></script>
>> +    <script src="script/jquery.js"></script>
>> +    <script src="script/jquery.couch.js"></script>
>> +    <script src="script/jquery.dialog.js"></script>
>> +    <script src="script/futon.js"></script>
>> +    <script src="script/couch.js"></script>
>> +    <script src="script/couch_test_runner.js"></script>
>>     <script>
>>     $(function($) {
>>       $("#result").html("");
>>
>>
>
> Though this caching numbers are useful when you use it in prod...
> Since we don't change futon often. A better response imo is that we
> *must* change them when the file is changed and not necessarily when
> couchdb version is changing, no?
>

Mochiweb responds with a last-modified header based on the mtime. With
this change, browsers are told that they can cache the request, but
they should revalidate, which means sending the if-modified-since
validation header. Mochiweb sees this and responds with 304 *if the
file hasn't changed*. So I think this patch introduces very correct
behavior.

I see the argument that perhaps, since this doesn't really change
often, that autotools is maybe a better solution. A production server
doesn't even have to service these 304 responses. The problem is that
a cached futon still references old version numbers in the query
strings and so the rest of the files may also still be served from
cache. Revalidation is the key to not serving stale responses. Perhaps
an Expires header could be added if we wanted to push HTTP/1.0 clients
to revalidate, too.

One answer I see is to allow this to be configured, but I think that's
overkill. If high traffic with 304 responses to your admin console is
a problem on a production server, the user should probably take care
of that a different way, such as by masking futon off from the outside
world with vhosts.

-R

Mime
View raw message