Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple calls to swf file #72

Open
jhfrench opened this issue Dec 12, 2014 · 4 comments
Open

Multiple calls to swf file #72

jhfrench opened this issue Dec 12, 2014 · 4 comments

Comments

@jhfrench
Copy link

I happened to notice in my application that the copy_csv_xls_pdf.swf is getting called three times when datatables/tabletools are invoked. I put together a jsfiddle to illustrate the issue:

Multiple calls to the same file

The same behavior can be observed from the TableTools documentation:
Even from the official documentation

Why is this file getting loaded multiple times? It's particularly problematic because the intial load of the file doesn't seem to be cached by the browser for subsequent loads.

@alesnav
Copy link
Contributor

alesnav commented Dec 12, 2014

I think that it is loaded in a per flash button basis. So, do you have
three buttons (flash type buttons) in your datatable?
El 12/12/2014 18:25, "Jeromy French" [email protected] escribió:

I happened to notice in my application that the copy_csv_xls_pdf.swf is
getting called three times when datatables/tabletools are invoked. I put
together a jsfiddle to illustrate the issue
http://jsfiddle.net/jhfrench/6b74w/391/:

[image: Multiple calls to the same file]
https://cloud.githubusercontent.com/assets/1501167/5415872/825b7916-81f8-11e4-838c-a65c4756fc14.png

The same behavior can be observed from the TableTools documentation
https://datatables.net/extensions/tabletools/:
[image: Even from the official documentation]
https://cloud.githubusercontent.com/assets/1501167/5416022/9f5f7dfe-81f9-11e4-9455-7c274417b1f4.png

Why is this file getting loaded multiple times? It's particularly
problematic because the intial load of the file doesn't seem to be cached
by the browser for subsequent loads.


Reply to this email directly or view it on GitHub
#72.

@jhfrench
Copy link
Author

I do have three buttons (copy, excel, pdf). The tabletools documentation has 5 buttons, but calls the file 4 times (perhaps the "print" button doesn't invoke the flash file).

Even if this is the root of the multiple calls...is it necessary?

@DataTables
Copy link
Collaborator

The swf file is indeed loaded once for each button. The SWF file is the same for the buttons, and I've never understood why the are multiple requests for the same file... Browsers just seem not to cache it.

Hmmm - looking at my examples with Chrome, for some reason, Chrome is sending:

Cache-Control:max-age=0

That might explain the problem, but not why it is sending that... Need more investigation I think!

(meanwhile we raise a glass to the day in the future when we can get rid of the Flash dependency here...)

@jhfrench
Copy link
Author

Cross-posted this to stackoverflow.com. Maybe one of those smart cookies can figure this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants