You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a flag $CGI::Util::SORT_ATTRIBUTES to make CGI.pm output HTML elements in deterministic order. Without it, under recent perl versions, the HTML output will change randomly from one run to the next. The test suite has been fixed to set the flag where necessary. But I suggest that the most useful course of action all round is to set the flag by default.
Most applications will benefit from making the HTML output deterministic (as it always used to be, at least within a single machine and perl version). For example, sites such as the Internet Archive monitor a page to see whether it is different from the previous version.
I think the 'cost' of sorting hash keys is really a non-issue. The hash of attributes in an HTML element contains at most a dozen elements, and the sorting is done in C code. It is not going to make any real world difference to the performance of the page. (Indeed, if the attributes appear in a regular order the HTML will be more compressible by gzip, so is likely to load slightly faster in the case where Deflate compression is used in the HTTP request.) So please could I ask that sorting keys be turned on by default.
The text was updated successfully, but these errors were encountered:
(following on from issue 106)
There is a flag
$CGI::Util::SORT_ATTRIBUTES
to make CGI.pm output HTML elements in deterministic order. Without it, under recent perl versions, the HTML output will change randomly from one run to the next. The test suite has been fixed to set the flag where necessary. But I suggest that the most useful course of action all round is to set the flag by default.Most applications will benefit from making the HTML output deterministic (as it always used to be, at least within a single machine and perl version). For example, sites such as the Internet Archive monitor a page to see whether it is different from the previous version.
I think the 'cost' of sorting hash keys is really a non-issue. The hash of attributes in an HTML element contains at most a dozen elements, and the sorting is done in C code. It is not going to make any real world difference to the performance of the page. (Indeed, if the attributes appear in a regular order the HTML will be more compressible by gzip, so is likely to load slightly faster in the case where Deflate compression is used in the HTTP request.) So please could I ask that sorting keys be turned on by default.
The text was updated successfully, but these errors were encountered: