Nginx 的 pagespeed 模块是已经 out 了吗?我看有的帖子说是收费的?

4 小时 59 分钟前
 52txr

debian12 想安装一直安装不上,是参考的下面这些文章:

https://zhuanlan.zhihu.com/p/352358098 https://cn.linux-console.net/?p=9254

415 次点击
所在节点    云计算
7 条回复
52txr
4 小时 52 分钟前
407 | if (r->headers_out.cache_control.elts == NULL) {
| ^~~~
/usr/local/nginx/modules/incubator-pagespeed-ngx-1.13.35.2-stable/src/ngx_pagespeed.cc:408:35: error: cannot convert ‘ngx_table_elt_t**’ {aka ‘ngx_table_elt_s**’} to ‘ngx_array_t*’
408 | ngx_int_t rc = ngx_array_init(&r->headers_out.cache_control, r->pool,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| ngx_table_elt_t** {aka ngx_table_elt_s**}
In file included from src/core/ngx_core.h:66,
from src/http/ngx_http.h:13,
from /usr/local/nginx/modules/incubator-pagespeed-ngx-1.13.35.2-stable/src/ngx_pagespeed.h:33,
from /usr/local/nginx/modules/incubator-pagespeed-ngx-1.13.35.2-stable/src/ngx_pagespeed.cc:26:
src/core/ngx_array.h:32:29: note: initializing argument 1 of ‘ngx_int_t ngx_array_init(ngx_array_t*, ngx_pool_t*, ngx_uint_t, size_t)’
32 | ngx_array_init(ngx_array_t *array, ngx_pool_t *pool, ngx_uint_t n, size_t size)
| ~~~~~~~~~~~~~^~~~~
/usr/local/nginx/modules/incubator-pagespeed-ngx-1.13.35.2-stable/src/ngx_pagespeed.cc:415:22: error: cannot convert ‘ngx_table_elt_t**’ {aka ‘ngx_table_elt_s**’} to ‘ngx_array_t*’
415 | ngx_array_push(&r->headers_out.cache_control));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| ngx_table_elt_t** {aka ngx_table_elt_s**}
src/core/ngx_array.h:27:35: note: initializing argument 1 of ‘void* ngx_array_push(ngx_array_t*)’
27 | void *ngx_array_push(ngx_array_t *a);
| ~~~~~~~~~~~~~^
/usr/local/nginx/modules/incubator-pagespeed-ngx-1.13.35.2-stable/src/ngx_pagespeed.cc: In function ‘bool net_instaweb::{anonymous}::ps_get_cache_control(ngx_http_request_t*, GoogleString*)’:
/usr/local/nginx/modules/incubator-pagespeed-ngx-1.13.35.2-stable/src/ngx_pagespeed.cc:439:74: error: request for member ‘elts’ in ‘r->ngx_http_request_s::headers_out.ngx_http_headers_out_t::cache_control’, which is of pointer type ‘ngx_table_elt_t*’ {aka ‘ngx_table_elt_s*’} (maybe you meant to use ‘->’ ?)
439 | auto ccp = static_cast<ngx_table_elt_t**>(r->headers_out.cache_control.elts);
| ^~~~
/usr/local/nginx/modules/incubator-pagespeed-ngx-1.13.35.2-stable/src/ngx_pagespeed.cc:444:59: error: request for member ‘nelts’ in ‘r->ngx_http_request_s::headers_out.ngx_http_headers_out_t::cache_control’, which is of pointer type ‘ngx_table_elt_t*’ {aka ‘ngx_table_elt_s*’} (maybe you meant to use ‘->’ ?)
444 | for (ngx_uint_t i = 0; i < r->headers_out.cache_control.nelts; i++) {
| ^~~~~
make[1]: *** [objs/Makefile:1324: objs/addon/src/ngx_pagespeed.o] Error 1
make[1]: Leaving directory '/home/lighthouse/nginx-1.27.1'
make: *** [Makefile:10: build] Error 2
52txr
4 小时 46 分钟前
我也试了 Nginx1.18 ,完全按照教程来。

我只是瞎折腾,确实也不是急需的东西。如果有大佬 i 知道有什么坑,希望指点一二
rrfeng
4 小时 37 分钟前
前端工程化之后这些都被前端构建做完了……(除了图像压缩之类
skallz
4 小时 34 分钟前
不建议使用,过于老旧,带来的结果完全未知
ranaanna
4 小时 28 分钟前
免费,开源。需要编译 nginx 源码启用模块。但请不要参考知乎之类。请看正规来源 https://developers.google.com/speed/pagespeed/module 。用这个模块并不需要提供付款信息,所以免费是一定的。默认有数量上的限制,1 天上限 25,000 次,100 分钟内上限 400 次。如果不够可以向 google 免费申请提高上限

如果 debian 12 和最新 nginx mainline ,自动安装的话可以简单到
bash <(curl -f -L -sS https://ngxpagespeed.com/install) --nginx-version latest 。手动安装似乎也不复杂

OP 应该说一说在哪里出现问题导致“一直安装不上”
yuedanwork
4 小时 28 分钟前
https://github.com/apache/incubator-pagespeed-ngx

status: Archived

目前不建议服务端使用了。不管是后端实时渲染还是前端打包的产物,时下都有相应的更好的解决方案。
52txr
4 小时 13 分钟前
@rrfeng
@skallz
@ranaanna
@yuedanwork
好嘞,感谢各位大佬的解答!

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1098871

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX