The OpenD Programming Language

gzipRecommendedForContentType

Returns true if I recommend gzipping content of this type. You might want to call it from your Presenter classes before calling cgi.write.

cgi.setResponseContentType(yourContentType);
cgi.gzipResponse = gzipRecommendedForContentType(yourContentType);
cgi.write(yourData, true);

This is used internally by serveStaticFile, serveStaticFileDirectory, serveStaticData, and maybe others I forgot to update this doc about.

More...
version(with_breaking_cgi_features)
bool
gzipRecommendedForContentType
()

Detailed Description

The implementation considers text content to be recommended to gzip. This may change, but it seems reasonable enough for now.

Meta

History

Added January 28, 2023 (dub v11.0)