压缩和安全是否安全?随意重新格式化网页HTML?推荐任何压缩工具? [英] Is it safe to compress & reformat web-page HTML at will? Recommend any compression tool?

查看:68
本文介绍了压缩和安全是否安全?随意重新格式化网页HTML?推荐任何压缩工具?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Dreamweaver 4





任何人都可以推荐一款不错的实用程序来压缩

HTML是安全的 - 即*在任何浏览器中出现*绝对*不会混乱




我运行一个不断增长的网站,其页面无情地得到

也是沉重的。


我希望能够压缩HTML以供使用

然后再应用来源格式化和QUOT; (DW4)随后将调整




- 可以随意压缩和重新格式化网页HTML吗?


背景:

我理解目标是(或曾经是!)每页40KB,

但我们现在正努力保持我们的页面100KB以下

(包括图形)

发货

Shiperton Henethe

解决方案

Shiperton Henethe写道:

[snip]

我经营着一个不断发展的网站,其页面无情地得到了沉重。

我希望能够压缩HTML以供使用
然后再应用源格式。 (DW4)随意将
进行调试。
[snip]背景:
我理解目标是(或曾经是!)每页40KB,
但我们现在正在努力保持我们的页面不超过100KB
(包括图片)




只是评论。您是否尝试过手动压缩一页?看看

有多大的潜力?


例如,如果你可以在一个75KB的页面上创建一个100KB的页面,你有一个

好​​的情况。但如果它只进入(比方说)一个95KB的页面,那么你的问题就在其他地方,至少在最初的时候就是



另外,你有没有尝试过D4代码格式首选项?


(我会兴趣地看这个帖子 - 我也使用D4和ASF来使

来源易于阅读!我刚尝试过54KB页面,用手减少到44KB

压缩)。


-

Barry Pearson
http://www.Barry.Pearson.name/photography/
http://www.BirdsAndAnimals.info/
http://www.ChildSupportAnalysis.co.uk/




" Barry Pearson" <是ne ** @ childsupportanalysis.co.uk>在消息中写道

news:g _ ************** @ newsfep1-gui.server.ntli.net ...

Shiperton Henethe写道:
[snip]

我经营着一个不断发展的网站,其页面无情地得到了沉重。

我想成为能够压缩HTML以供使用
然后应用源格式 (DW4)随意将
进行调试。 [snip]

背景:
我理解目标是(或曾经是!)每页40KB,
但我们现在正努力让我们的页面保持在100KB以下/>(包括图形)



只是评论。您是否尝试过手动压缩一页?看看



有多大的潜力?


是的,我只是试图剥离各种各样的东西,比如备用

空格和/或标签和回车单,这个帮助相当有用

很多。 (46K中的8K)


这是相当乏味的,我不得不使用HomeSite来做它。


例如,如果你可以将一个100KB的页面变成(比方说)一个75KB的页面,你有
a的好例子。但如果它只进入(比方说)一个95KB的页面,你的问题
就在其他地方,至少在最初阶段。

另外,你是否尝试过D4代码格式?偏好?



好​​吧,坦白说DW4是完全奇怪的。


DW4似乎是缩进< TABLE>一个空格和

< TR>使用两个空格。 Butd缩进为< TD>

三个空格或一个标签取决于它当时的感觉

。 (记住我在

之前已经删除了所有这些,所以每一行都开始撞到左边缘)。


我的35.7KB得到近3KB的额外字符由

添加代码格式。


FWIW我的代码格式设置是:

缩进是,使用标签,缩进表格行和列

缩进尺寸= 1,标签尺寸= 3,没有自动包装......

发货

Shiperton Henethe







Shiperton Henethe写道:

" Barry Pearson" <是ne ** @ childsupportanalysis.co.uk>在消息中写道
新闻:g _ ************** @ newsfep1-gui.server.ntli.net ...

Shiperton Henethe写道:< br> [snip]

>我经营着一个不断发展的网站,其页面无情地得到了
>也是沉重的。
>
>我希望能够压缩HTML以供使用
>然后到应用源格式 (DW4)随意
>为了调试。 [snip]

>背景:
>我理解目标是(或曾经是!)每页40KB,
>但我们现在正努力让我们的页面保持在100KB以下
> (包括图形)



只是评论。您是否尝试过压缩一页手动
以查看有多大潜力?



是的我只是尝试剥离各种各样的东西,例如备用空格和/或标签和回车单独返回这个帮助
非常多。 (46K中的8K)




有用,但仍然只是从100KB到40KB的部分旅程!


我'我在下面添加了一些建议。

这是相当繁琐的,我不得不使用HomeSite来做。



[snip]


是的!我只是建议它作为一个实验,而不是作为

未来的方式。 (我使用Word是因为它的find& replace是我熟悉的东西

with,它有宏。但只适用于一次性实验)。

如果您的内容真的很大,那么您就会陷入困境。 (你也许可以拆分

页面)。但是这里有一些其他的可能性,取决于你的

情况:


- 我曾经有很多带有翻转Javascript的GIF按钮。我进入了

CSS最初只是为了摆脱这一切。如果CSS只做按钮,我会

仍然是粉丝! (每个页面都有用于翻转的Javascript - 也许我可以将b $ b链接到它?但是,最糟糕的是,所有的按钮必须是

加载到看到主页,悬停按钮也预装了。)


- 摆脱字体并用CSS替换它帮助我的一些页面有用,但不是很壮观,数量。


- 我注意到你说的是图形。我在一些摄影网站上看过的东西

是使用全尺寸图像作为缩略图,按照

" img"中的属性调整大小。标签,而不是使用真正的缩略图。 (对不起,如果我指出

显而易见!)


- 您是否优化了任何照片的压缩?我看到很多

非优化的JPEG压缩,大部分压缩过度,但有些压缩不足。


- 如果你的图形是GIF,你有没有调查过PNG? (我仍然使用GIF,但是

我没有大量的数字。我听说PNG在某些情况下会变小。

我不知道它的浏览器支持有多好。)


-

Barry Pearson
http://www.Barry.Pearson.name/photography/
http://www.BirdsAndAnimals.info/
http://www.ChildSupportAnalysis.co.uk/


Dreamweaver 4

Hi

Can anyone recommend a decent utility for compressing
HTML that is safe - i.e. that *definitely* doesn''t mess
with the appearance in any browsers.

I run a growing website whose pages are inexorably getting
too "heavy".

I want to be able to compress the HTML for use
and then to "Apply Source Formatting" (DW4) at will
in order to debug.

- Is it safe to compress and reformat web-page HTML at will?

Background:
I understand the target is (or used to be!) 40KB per page,
but we are now struggling to keep our pages under 100KB
(including graphics)
Ship
Shiperton Henethe

解决方案

Shiperton Henethe wrote:
[snip]

I run a growing website whose pages are inexorably getting
too "heavy".

I want to be able to compress the HTML for use
and then to "Apply Source Formatting" (DW4) at will
in order to debug. [snip] Background:
I understand the target is (or used to be!) 40KB per page,
but we are now struggling to keep our pages under 100KB
(including graphics)



Just a comment. Have you tried compressing just one page "by hand" to see how
much potential there is?

For example, if you can make a 100KB page into (say) a 75KB page, you have a
good case. But if it only makes it into (say) a 95KB page, your problems lie
elsewhere, at least initially.

Also, have you experimented with the D4 "Code format" preferences?

(I will watch this thread with interest - I too use D4 & ASF to make the
source easy to read! I just tried a 54KB page and it reduced to 44KB with hand
compression).

--
Barry Pearson
http://www.Barry.Pearson.name/photography/
http://www.BirdsAndAnimals.info/
http://www.ChildSupportAnalysis.co.uk/



"Barry Pearson" <ne**@childsupportanalysis.co.uk> wrote in message
news:g_**************@newsfep1-gui.server.ntli.net...

Shiperton Henethe wrote:
[snip]

I run a growing website whose pages are inexorably getting
too "heavy".

I want to be able to compress the HTML for use
and then to "Apply Source Formatting" (DW4) at will
in order to debug. [snip]

Background:
I understand the target is (or used to be!) 40KB per page,
but we are now struggling to keep our pages under 100KB
(including graphics)



Just a comment. Have you tried compressing just one page "by hand" to see


how much potential there is?
Yes I just tried stripping out various things such as spare
spaces and/or tabs and carriage returns by themselves and this help quite a
lot. (8K out of 46K)

This was rather tedious and I had to use HomeSite to do it though.

For example, if you can make a 100KB page into (say) a 75KB page, you have a good case. But if it only makes it into (say) a 95KB page, your problems lie elsewhere, at least initially.

Also, have you experimented with the D4 "Code format" preferences?


Well, frankly DW4 is totally bizarre.

DW4 seems to be indenting <TABLE> with one space and
<TR> using two spaces. Butd is indented with either <TD> with
either three spaces OR a single tab depending how it''s feeling
at the time. (Remember I had stripped out ALL of these before
so that each line started bang up against the left margin).

My 35.7KB gets nearly 3KB of extra characters added by
the Code formatting.

FWIW my "code format" settings are:
Indent yes, Use tabs, Indent table rows and columns
indent size =1, Tab size=3, no automatic wrapping...
Ship
Shiperton Henethe








Shiperton Henethe wrote:

"Barry Pearson" <ne**@childsupportanalysis.co.uk> wrote in message
news:g_**************@newsfep1-gui.server.ntli.net...

Shiperton Henethe wrote:
[snip]

> I run a growing website whose pages are inexorably getting
> too "heavy".
>
> I want to be able to compress the HTML for use
> and then to "Apply Source Formatting" (DW4) at will
> in order to debug. [snip]

> Background:
> I understand the target is (or used to be!) 40KB per page,
> but we are now struggling to keep our pages under 100KB
> (including graphics)



Just a comment. Have you tried compressing just one page "by hand"
to see how much potential there is?



Yes I just tried stripping out various things such as spare
spaces and/or tabs and carriage returns by themselves and this help
quite a lot. (8K out of 46K)



Useful, but still only part of the journey from 100KB to 40KB!

I''ve added some more suggestions below.
This was rather tedious and I had to use HomeSite to do it though.


[snip]

Yes! I was only suggesting it as an experiment, not as the way to go for the
future. (I used Word because its "find & replace" is something I am familiar
with, and it has macros. But only for a one-off experiment).

If your content really is big, you are stuck with it. (You could perhaps split
pages). But here are some other possibilities, depending on your
circumstances:

- I used to have a lot of GIF-buttons with roll-over Javascript. I got into
CSS originally just to get rid of all that. If CSS only did buttons, I would
still be a fan! (Every page had the Javascript for rollover on it - perhaps I
could have linked to it? But, worst of all, all the up buttons had to be
loaded to see the home page, and the hover buttons were also preloaded).

- Getting rid of "font" and replacing it with CSSs helped some of my pages a
useful, but not spectacular, amount.

- I note you said "graphics". Something I have seen on some photography sites
is the use of full sized images as thumbnails, resized by attributes in the
"img" tag, instead of use of real thumbnails. (Sorry if I am pointing out the
obvious there!)

- Have you optimised the compression of any photographs? I see a lot of
non-optimum compression of JPEGs around, mostly over-compressed but some
under-compressed.

- If your graphics are GIFs, have you investigated PNG? (I still use GIFs, but
I don''t have vast numbers. I have heard that PNG can be smaller in some cases.
I don''t know how good its browser support is).

--
Barry Pearson
http://www.Barry.Pearson.name/photography/
http://www.BirdsAndAnimals.info/
http://www.ChildSupportAnalysis.co.uk/


这篇关于压缩和安全是否安全?随意重新格式化网页HTML?推荐任何压缩工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆