I just noticed this thread so I added this line to my code:

...
configUrl : 'config.php?nocache=' + new Date().getTime(),
...

Now I have everything working the way I want! Specifically, refreshing the browser's page displays new images. Correct me if I'm wrong, here's my understanding of what's happening.

(1) Adding the line

header("Cache-Control: max-age=86400");

to my config.php file allows it to be client-side cached so that it only gets referenced once - either by the juicebox js so the expand button works as advertised or, say, the browser's back button re-displays the same images.
(2) Adding the time stamp to a bogus variable being passed to my config.php file says that when the browser's refresh button is pressed, a new time stamp is generated and this kicks off a new server-side update reuest, effectively loading new images.

This all seems to play well with the juicebox js code. Do you think it'll work ok or do you think it's problematical? Note that I have tested this on the three major browsers Firefox, Chrome, and Explorer with the same correct behavior on each.

FWIW I performed a bunch of experiments. My working baseline is enabling caching in my php file and using the configURL option. Results as described above: expand button works but images don't necessarily refresh with browser page refreshes.

1) I moved the caching enabling to .htaccess in my server root instead of the php file. Results were identical, no change.
2) I tried enabling the randomizeImages option just for the heck of it and, other than having the images being truly randomized, the results were identical. Again, no change.
3) Again just for the heck of it, I enabled randomizeImages but this time I disabled the caching in my php file. This time the expand button failed as before by generating new images.

So I think I'll continue using 1.4.4.2 with the caching option that you provided. If anyone of my forum users complains I can always go back to 1.3.3 but I doubt there will be an issue. Interesting problem but not a game changer - just wish it operated the same as 1.3.3.

Thanks for the suggestions and help Steven. It is appreciated!

Hi Steven, here's a lot of description.

I decided to first try another approach. If caching were an issue I reasoned that if I could encompass more of the juicebox code with my custom code I would stand a better chance. So I eliminated the configURL option and, instead, used my php code to actually generate a real config.xml file and the juicebox declaration. My html file looks something like this (much simplified and only showing relavant code):

<script src="jb_gallery/jbcore/juicebox.js"></script>
<?php include("jb_gallery/config.php"); ?>  <!-- for v1.4.4.2 -->
<div id="jb_container"></div>

This version of config.php creates a new config.xml file every time (with random images from server side) and the following juicebox code:

<script>new juicebox({
    baseUrl : 'jb_gallery/',
    containerId : 'jb_container',
    galleryWidth: '350px',
    galleryHeight: '350px',
    backgroundColor: '#222222'
});</script>

This solution almost worked. The expand button worked just fine but when I repeatedly refreshed my browser page every once in a while the gallery didn’t display anything - it was just black and there was no rotating juicebox wheel. I suspect that there is some synchronization between the juicebox code and my server side calls that isn’t happening. Without further insight into this, such as a handshake condition between the juicebox code and my config.xml file generation, there doesn’t seem to be more that I can do in this direction.

You said that you could not replicate my problem with your random photo php generator code. But were you doing server side calls like me? I generate random photos via server side file system and data base access. When I was using 1.3.3 this worked perfectly: every time I refreshed the page I would get 8 new photos and every time I used the expand button I would expand those same 8 images. All browser settings were default and all sever side settings were default (no special cache instructions). If all I do is switch to 1.4.4.2 I get the aforementioned problem behavior with expand. What changed with juicebox?

I did play around with caching as this just may be the state of affairs with the newer editions of juicebox. With your code in my php file (using my original configURL option setting) the expand button works. If I continually refresh the page, occasionally I’ll get 8 new images; otherwise, it’s the same 8 images. Likewise I get this same behavior if I do “F5” or “Ctrl+F5”. In all cases expand works just fine but, ideally, I would like to get 8 new images consistently when I refresh like with 1.3.3.

Any ideas how I can make this work better? I do appreciate the help so let me know if you need more information.

Steven, thanks for the prompt reply. This is just a quick reply that I'm working on it. I thought the issue could be caching but this is tricky stuff to get right. So I'm trying to figure out the right combination to get what I want since, yes, I can alter behavior with the header control - but this interacts also with the browser's cache clearing with page refresh, F5, etc.

I'm experimenting with all this now and will post again soon. The short answer is that this does indeed preserve the expand button images.

Hello and thanks for this great product. I just upgraded from v1.3.3 to v1.4.4.2 and unfortunately I see a different behavior using the expand button.

I use juicebox in embedded mode and I have configUrl set to load my php file to dynamically generate 8 images randomly from a file system for the gallery. In v1.3.3 the expand button worked as expected: the same 8 images are accessed in expand mode so the user can see the same expanded images. In v1.4.4.2 the expand button produces a new set of 8 images. When I return from expand mode I get the original 8 images. If I hit the expand button again, I again get 8 new images (different from the other 8 new images from the first time I used the expand button). So it seems that juicebox is now executing my configUrl file again when the expand button is pressed?

So that you can look at this I have temporarily enabled the correct features on my homepage, http://mountainhandbook.com. This behavior is identical in the latest Chrome (47.0.2526.106) and Firefox (42.0).

Any insight into this would be much appreciated. I searched your forums and didn't see anything relevant to this, which kind of surprised me.

Best regards.