AJAX and JSON encoded content
-
I am not sure if it’s treated in this version of the plugin (at least it’s not in “WP Minify”), but i have noticed a potential issue with AJAX requests that are JSON encoded in conjunction with HTML minify. Basically, it should not minify responses from AJAX requests, because these responses can be corrupted and unreadable.
For example:
{"test": "<div class=\"hello\"></div>"}
and an HTML minified response would look:
{"test": "<div class=\"hello\"></div>"}
There can be a condition that it won’t run “modify_buffer” function when it’s an AJAX request, perhaps via a global variable HTTP_X_REQUESTED_WITH.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘AJAX and JSON encoded content’ is closed to new replies.