html限制字符最小,什么是将HTML页面大小限制为8000个字符?

必须有一些非常明显的东西我失踪了,但是这里:

我们网页的大部分内容都是由服务器端的包含或后期的页面加载AJAX调用生成的,因此HTML文件的大小一般相当小.但是,当创建测试页面时,没有任何复杂的东西,我发现如果页面大小超过8000个字符,服务器不会传输页面.

这是一个示例文件:

Rubbish

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

重复最后一行16次,共计完成17条.然后添加一行的这一部分:

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliq.

以上是共有8001个字符,无法加载消息“Safari无法加载页面,因为服务器意外关闭连接”以及使用Firefox和Chrome的变体.删除最后的完整停止或任何其他字符会使字符倒数,因此页面按预期加载.

任何人都可以给我一个线索,说明我没有能够加载这样一个简单的文件吗?

答案(一种):很明显,这是mod_deflate导致问题,所以在一些谷歌搜索后,我问服务器缺失,如果有人知道如何改变最大的大小.没有响应,所以我创建了一个shell文件,并将原始的8000个字符文件作为服务器端包含(SSI),它现在按预期工作.仍然不知道为什么在纯HTML上有限制,但在SSI上没有限制,但是我没有时间再担心.

编辑:删除“SetOutputFilter DEFLATE”指令,现在加载页面,这表明它确实是导致问题的deflate模块.添加“DeflateBufferSize 10000”(或者“DeflateBufferSize 2048”)对所支持的大小没有任何影响,因此我将关闭此问题并询问服务器故障时的模块泄漏.

编辑:对不起,应该提到我们在Fedora 14上使用Apache 2.2.17.这是在笔记本电脑的虚拟机上,所以没有外部因素.

编辑:另外我应该补充的是,即使使用loglevel进行调试,Apache错误日志中也没有任何内容.访问日志提供“200”消息,但发送的字符数设置为“ – ”.

编辑:以下是编辑httpd.conf,没有其他配置文件.输出放大,然后由客户端解压缩:

### Section 1: Global Environment

ServerTokens prod

CoreDumpDirectory /tmp

ServerRoot "/etc/httpd"

PidFile run/httpd.pid

Timeout 120

KeepAlive On

MaxKeepAliveRequests 100

KeepAliveTimeout 5

StartServers 20

MinSpareServers 5

MaxSpareServers 20

ServerLimit 256

MaxClients 256

MaxRequestsPerChild 4000

StartServers 2

MaxClients 150

MinSpareThreads 25

MaxSpareThreads 75

ThreadsPerChild 25

MaxRequestsPerChild 0

Listen 80

#SOME LOAD MODULE CONFIG LINES REMOVED

LoadModule include_module modules/mod_include.so

LoadModule env_module modules/mod_env.so

LoadModule ext_filter_module modules/mod_ext_filter.so

LoadModule expires_module modules/mod_expires.so

LoadModule deflate_module modules/mod_deflate.so

LoadModule headers_module modules/mod_headers.so

LoadModule dav_module modules/mod_dav.so

LoadModule status_module modules/mod_status.so

LoadModule info_module modules/mod_info.so

LoadModule dav_fs_module modules/mod_dav_fs.so

LoadModule actions_module modules/mod_actions.so

LoadModule cache_module modules/mod_cache.so

LoadModule cgi_module modules/mod_cgi.so

Include conf.d/*.conf

ExtendedStatus Off

User apache

Group apache

### Section 2: 'Main' server configuration

ServerAdmin root@localhost

ServerName www.example.com:80

UseCanonicalName Off

DocumentRoot "/var/www/html"

Options FollowSymLinks

AllowOverride None

Options Indexes FollowSymLinks

AllowOverride None

Order allow,deny

Allow from all

UserDir disabled

DirectoryIndex index.html index.html.var

AccessFileName .htaccess

Order allow,deny

Deny from all

TypesConfig /etc/mime.types

DefaultType text/plain

MIMEMagicFile conf/magic

HostnameLookups Off

#LOG CONFIG LINES REMOVED

ServerSignature Off

Alias /icons/ "/var/www/icons/"

Options Indexes MultiViews FollowSymLinks

AllowOverride None

Order allow,deny

Allow from all

DAVLockDB /var/lib/dav/lockdb

IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable Charset=UTF-8

#ICON CONFIG LINES REMOVED

ReadmeName README.html

HeaderName HEADER.html

IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

#LANGUAGE CONFIG LINES REMOVED

AddDefaultCharset UTF-8

AddType application/x-compress .Z

AddType application/x-gzip .gz .tgz

AddType application/x-x509-ca-cert .crt

AddType application/x-pkcs7-crl .crl

AddHandler send-as-is asis

AddHandler type-map var

AddOutputFilter INCLUDES .html .xml

AddType application/x-httpd-php .php .html

Alias /error/ "/var/www/error/"

AllowOverride None

Options IncludesNoExec

AddOutputFilter Includes html

AddHandler type-map var

Order allow,deny

Allow from all

LanguagePriority en es de fr

ForceLanguagePriority Prefer Fallback

#BROWSER MATCH CONFIG LINES REMOVED

SetHandler server-status

Order deny,allow

Deny from all

Allow from 127.0.0.1

SetHandler server-info

Order deny,allow

Deny from all

Allow from 127.0.0.1

### Section 3: Virtual Hosts

NameVirtualHost *:80

FcgidMaxRequestLen 2000000

FcgidMinProcessesPerClass 5

FcgidIdleTimeout 18000

FcgidIOTimeout 60

TraceEnable Off

SetEnvIf User-Agent ".*MSIE.*" ISIE true

ServerName www.example.com

UseCanonicalName off

DocumentRoot /etc/httpd/www/examples/

DirectoryIndex index.html index.html.var

CheckSpelling on

CheckCaseOnly on

Options Includes

AllowOverride None

Order Deny,Allow

Allow from all

Header Set Cache-Control "max-age=10"

ExpiresActive On

ExpiresByType text/html "access plus 10 seconds"

ExpiresByType image/gif A259200

ExpiresByType image/jpg A3600

ExpiresByType text/html A259200

ExpiresByType image/ico A259200

SetOutputFilter DEFLATE

Order Deny,Allow

Deny from All

#OTHER DIRECTORY CONFIG LINES REMOVED

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值