Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Caching uploadify files crashes the chrome

I am using uploadify. when i try to open the page with uploadify script the page is crashed. I using this for a long time. but now only I am getting the error.

Its happening only in chrome. Its working perfectly in firefox, safari, and IE.

I searched through the google and find a solution like disable cache in the browser(working). But its not the best way to do this in the client browser. Is there any way to disable cache for the specific page using htaccess?

I tried the following in the htaccess. but no use.

<Files jquery.uploadify.js>
    ExpiresDefault "access plus 0 seconds"
</Files>

Please suggest me to solve this problem.

like image 386
Mahendran Sakkarai Avatar asked Nov 28 '22 01:11

Mahendran Sakkarai


1 Answers

Finally i solved it by adding an extra parameter(changing the URL or versioning the file) ?ver=<?php echo rand(0,9999);?> to the .js file like below.

<script src="js/jquery.uploadify.min.js?ver=<?php echo rand(0,9999);?>" type="text/javascript"></script>

For more information check this

UPDATE(27-01-2015):

The above solution is not working now. Found another solution. Add timeout around the uploadify function like below will prevent the chrome to crash. Its not the correct solution but it will prevent now. The forum of uploadify also locked. So, I cant able to post a question regard this.

setTimeout(function () {
    $("#uploadify_id").uploadify({})...
},0);

Thanks for everyone.

like image 128
Mahendran Sakkarai Avatar answered Nov 30 '22 22:11

Mahendran Sakkarai