ModPagespeedDisableFilters trim_urls

I

 

 

 

 

 

 

ssue 379:

trim_urls breaks relative reference in 0.10.19.5
 2 people starred this issue and may be notified of changes.Back to list
Status: Duplicate
Merged:issue 393
Owner:jmaes...@google.com
Closed:May 14
Cc:delor.th...@gmail.com


Sign in to add a comment
Reported by project member jmara...@google.com, Feb 9, 2012
From: thibaultdelor delor.thibault@gmail.com
9:17 PM (12 hours ago)

to mod-pagespeed-. 
Hey,
I have an issue with trim_urls which I could not solve.
I have page (/pages/node1) that dynamically load another content (/
content1). In /content1 I have an image (/img/bg.png). When getting in
ajax /content1, my image src attribute is changed to 'img/
bg.pnd.pagespeedXXXX'. The filter trim_urls is removing the / at the
begginning, and so when injecting into my main page, the image can't
be found (since it looks for /pages/mg/bg.pnd.pagespeedXXXX)

I am surprised that a google search don't return any similar case.
Have you a solution for that.
Is it possible to remove the filter trim_urls only for specifics pages
(for example a parameter in the url?). If I turn off completely the
trim_urls filter it works but all my resources are prefixed with my
site url (e.g http://www.mysite.com/img/bg.pnd.pagespeedXXXX) even
when adding a base tag...

Can I just said to pagespeed something like "add your suffix for
optimizing resources but don't touch my prefix, i know what I am
doing" :D

Cheers,
Regards

Tibo
Comment 1 by project member sligocki@google.com, Feb 9, 2012
delor.thibault, do you have a URL that demonstrates this problem? Thanks.
Comment 2 by delor.th...@gmail.com, Feb 9, 2012
The website is on pre-production server which is not public. But I have made a gist for you to illustrate my problem and show the bad result.
http://gist.github.com/1785003

Thanks


Comment 3 by project member jmara...@google.com, May 10, 2012
(No comment was entered for this change.)
Owner: jmaes...@google.com
Comment 4 by project member jmaes...@google.com, May 14, 2012
Confirmed.  The problem is indeed that trim_urls is absolutifying based on the position of the included html, rather than the ultimate position of the page into which it is inserted.  For example, myPartialContent.html had instead contained a relative path like "../js/myjs.js" the file would not be fetched at all and things would likely be *really* messed up.  Fundamentally, mod_pagespeed can't tell when you fetch myPartialContent.html that it will ultimately be injected into /pages/myMainContent.html, and ends up treating it like any other standalone page.

Your best expedient is to use .htaccess or an apache Directory section in your .conf files to enable trim_urls in /pages but leave it disabled in the root of your site:

Global config:
ModPagespeedDisableFilters trim_urls

.htaccess in /pages/:
ModPagespeedEnableFilters trim_urls

  More generally, disable trim_urls in directories that contain html that is being injected into a page residing at a different path.
Comment 5 by project member jmaes...@google.com, May 14, 2012
(No comment was entered for this change.)
Status: WontFix
Comment 6 by project member jmara...@google.com, May 29, 2012
(No comment was entered for this change.)
Status: Duplicate
Mergedinto: 393
Comment 7 by project member jmara...@google.com, May 29, 2012
Sorry about the confusion.  We gave in and decided to remove trim_urls from the core set due to this issue, which is the same as #393.  We already fixed this in trunk and it's in source release 0.10.22.3.  We will cut a new binary release soon.

 
 
 
      
      
hello, 在 conf.d\pagespeed.conf 第56行后面加一行 ,然后重启试试 ModPagespeedDisableFilters trim_urls
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值