OnDemandStreamResource / OnDemandFileDownloader not working with Firefox

Hello all,

I am using an OnDemandStreamResource in combination with an OnDemandFileDownloader
(similar to here: https://vaadin.com/forum#!/thread/4776052) to generate a PDF of a Table (with filtering functionality).
Everything works fine in Chrome: I can change the table content using filters and my PDF is generated correctly.
But in FireFox (latest version) changes in the table do not affect the streamResource and PDF generation. It looks like the resource is generated on application initialization and none of the methods is called onDemand.
Has anyone experienced a similar behaviour?
Or does anyone know how to solve this for FireFox?

Best, Jan

I’ve got the same problem. Everything works fine in Explorer but not in Firefox. In Firefox the files generated are empty. The filename though is correct.

public class OnDemandFileDownloader extends FileDownloader
{
    private static final long serialVersionUID = 8008927094527857275L;

    public interface OnDemandStreamResource extends StreamResource.StreamSource
    {
    	String getFilename();
    }

    private final OnDemandStreamResource onDemandStreamResource;

    public OnDemandFileDownloader(OnDemandStreamResource onDemandStreamResource)
    {
	    super(new StreamResource(onDemandStreamResource, ""));
	    this.onDemandStreamResource = onDemandStreamResource;
    }

    @Override
    public boolean handleConnectorRequest(VaadinRequest request,
    		VaadinResponse response, String path) throws IOException
    {
    	getResource().setFilename(onDemandStreamResource.getFilename());
	    getResource().setCacheTime(0);
	    return super.handleConnectorRequest(request, response, path);
    }

    private StreamResource getResource()
    {
	    return (StreamResource) this.getResource("dl");
    }
}

I also tried CacheTime 1000.
The funny thing is that sometimes, it even works in firefox but I cant tell what is different then. I also tried to empty the firefox cache manually as a user, but it did not help.