6.0.0-git
2019-07-21

[#13070] Deterministic Asset Names
Summary Deterministic Asset Names
Queue Horde Base
Queue Version Git master
Type Enhancement
State Resolved
Priority 1. Low
Owners slusarz (at) horde (dot) org
Requester o+horde (at) immerda (dot) ch
Created 2014-03-21 (1948 days ago)
Due
Updated 2014-07-15 (1832 days ago)
Assigned
Resolved 2014-03-23 (1946 days ago)
Milestone
Patch No

History
2014-07-15 16:35:09 o+horde (at) immerda (dot) ch Comment #8 Reply to this comment
Just saw this last comment...
thanks, for getting back
[...]
Why?  The files should be named the same.  i.e. the first connection 
to imp on a cluster results in a js file being created for the 
mailbox page -- all users will then use this file.
I was referring to a setup where backends would not have shared disk 
storage but only shared session storage. in this case every backend 
webserver will generates its own uniquely named resources. thus 
requests for js/css will fail since they are unlikely to hit the same 
backend.

For those kind of setup it would be nice if file hashes would contain 
version or content and not modification time.
2014-07-15 06:46:01 Michael Slusarz Comment #7 Reply to this comment
Just saw this last comment...
but since the assets (e.g. compressed js files) seem to be randomly 
named, when the request for assets goes to an arbitrary backend, 
they will not match the filenames produced by the replying horde 
instance.
They are not "randomly" named.  The name is the cache key - it is a 
hashed combination of the filenames contained in the file + the 
modification dates of those filenames.

Pages that use the same list of js/css files can re-use the existing 
files.  Modifying one of the constituent files will cause a new 
filename to be used/created.

[Show Quoted Text - 9 lines]
Why?  The files should be named the same.  i.e. the first connection 
to imp on a cluster results in a js file being created for the mailbox 
page -- all users will then use this file.
2014-03-23 11:24:05 o+horde (at) immerda (dot) ch Comment #6 Reply to this comment
hey, thanks for the fast reply. making the path configurable is quite 
nice in it self, but i meant something slightly different.

my initial problem was the following:

i have several horde installations behind a load-balancer. this one 
uses session-binding to redirect a certain user to a certain backend.

now i tried to serve the static assets through a different pipeline 
than the rest. so i configured a reverse-proxy to deliver them. since 
its only static assets i figured i don't need the session binding and 
it can fetch the assets from an arbitrary backend.

but since the assets (e.g. compressed js files) seem to be randomly 
named, when the request for assets goes to an arbitrary backend, they 
will not match the filenames produced by the replying horde instance.

of course i could just collect all assets and serve them from a 
separate place (that's probably what i'll do), or as you suggest in 
the conf.xml place the assets directory on a nfs share. but still i 
figured it would be nice if the assets had a deterministic name, then 
this would not be necessary.

additionally it would improve cache efficiency, since random names 
also means that every asset has to be cached once per backend on a 
reverse-proxy.
2014-03-23 05:27:50 Michael Slusarz Comment #5
Assigned to Michael Slusarz
State ⇒ Resolved
Reply to this comment
Horde 5.2.
2014-03-23 05:27:29 Git Commit Comment #4 Reply to this comment
Changes have been made in Git (master):

commit 8fab45af853a09772ad424af3e82dfb15c7e487f
Author: Michael M Slusarz <slusarz@horde.org>
Date:   Sat Mar 22 23:27:11 2014 -0600

     [mms] The location of dynamically served static files is now 
configurable (Request #13070).

  horde/config/registry.php |    4 ++++
  horde/docs/CHANGES        |    2 ++
  horde/docs/UPGRADING      |    8 ++++++++
  horde/lib/Test.php        |    8 +++++---
  horde/package.xml         |    1 +
  5 files changed, 20 insertions(+), 3 deletions(-)

http://git.horde.org/horde-git/-/commit/8fab45af853a09772ad424af3e82dfb15c7e487f
2014-03-23 05:27:26 Git Commit Comment #3 Reply to this comment
Changes have been made in Git (master):

commit 227d1c57cbeafa8d0a88c0576319eddddfde6163
Author: Michael M Slusarz <slusarz@horde.org>
Date:   Sat Mar 22 23:24:08 2014 -0600

     [mms] The location of dynamically served static files is now 
configurable (Request #13070).

  .../Core/lib/Horde/Registry/Registryconfig.php     |    9 +++++++++
  framework/Core/lib/Horde/Script/Cache/File.php     |    6 +++---
  framework/Core/lib/Horde/Themes/Css/Cache/File.php |    6 +++---
  framework/Core/package.xml                         |    2 ++
  4 files changed, 17 insertions(+), 6 deletions(-)

http://git.horde.org/horde-git/-/commit/227d1c57cbeafa8d0a88c0576319eddddfde6163
2014-03-23 04:36:25 Michael Slusarz Comment #2
Version ⇒ Git master
Queue ⇒ Horde Base
State ⇒ Accepted
Reply to this comment
We instead need to define the static directory as a configurable 
option in horde/config/registry.php.
2014-03-21 14:46:55 o+horde (at) immerda (dot) ch Comment #1
Type ⇒ Enhancement
State ⇒ New
Priority ⇒ 1. Low
Summary ⇒ Deterministic Asset Names
Queue ⇒ Horde Groupware Webmail Edition
Milestone ⇒
Patch ⇒ No
Reply to this comment
To be able to scale Horde to multiple instances, it would be nice if 
the assets (under /static) are named deterministically.

Thus a given pipeline would not have to implement session binding for 
delivering assets, they could be better cached or offloaded entirely.

Saved Queries