"No permission to rewrite" errors on third-party scripts

1,497 views
Skip to first unread message

David Hunt

unread,
Sep 29, 2016, 7:23:51 AM9/29/16
to mod-pagespeed-discuss
Hi,

I get a constant stream of "No permission to rewrite" messages in my PageSpeed logs. This leaves my 'Resources not rewritten because domain wasn't authorized' console graph at a pretty constant 25%.

The messages are all similar to:

[Thu, 29 Sep 2016 11:04:51 GMT] [Info] [13456] No permission to rewrite 'https://maps.googleapis.com/maps/api/js?sensor=false'
[Thu, 29 Sep 2016 11:04:51 GMT] [Info] [13456] No permission to rewrite 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js'
[Thu, 29 Sep 2016 11:04:51 GMT] [Info] [13456] No permission to rewrite 'https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'
[Thu, 29 Sep 2016 11:04:51 GMT] [Info] [13456] No permission to rewrite 'https://platform.twitter.com/oct.js'

Obviously these are all third-party scripts on other servers, so PageSpeed shouldn't even attempt to rewrite them.

I have set the ModPagespeedDomain parameter my pagespeed.conf file:

ModPagespeedDomain http*://*.leonardcheshire.org

How can I stop PageSpeed attempting to rewrite those scripts in the first place?

Cheers,

David

Jeff Kaufman

unread,
Sep 29, 2016, 7:26:19 AM9/29/16
to mod-pagespeed-discuss
These are info-level messages telling you that pagespeed looked at the
urls for these resources and determined that it didn't have permission
to rewrite them.

Can you turn your log level down from info to something less noisy?
> --
> You received this message because you are subscribed to the Google Groups
> "mod-pagespeed-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mod-pagespeed-di...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mod-pagespeed-discuss/00419dde-0da0-4caa-a227-ac0893a5a878%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

David Hunt

unread,
Sep 29, 2016, 8:02:47 AM9/29/16
to mod-pagespeed-discuss
Thanks for the reply.

My LogLevel in httpd.conf is set to 'error'. I think I read somewhere that PageSpeed messages ignores LogLevel.

But PageSpeed shouldn't even be looking at these resources at all (not even to determine whether or not it has permission). Not false-reporting a 25% failure rate for rewriting resources.

Jeff Kaufman

unread,
Sep 29, 2016, 8:11:33 AM9/29/16
to mod-pagespeed-discuss
On Thu, Sep 29, 2016 at 8:02 AM, David Hunt <davi...@gmail.com> wrote:
>
> My LogLevel in httpd.conf is set to 'error'. I think I read somewhere that
> PageSpeed messages ignores LogLevel.

PageSpeed should be paying attention to your LogLevel, and if you have
it set to "error" then it shouldn't be including these "info" messages
in your main apache log.

But you said "my PageSpeed logs"; where are you seeing these messages?

> But PageSpeed shouldn't even be looking at these resources at all (not even
> to determine whether or not it has permission).

PageSpeed has to look at these urls in order to figure out whether
you've given them permission. Like, it has to pull the url out of
your html, compare the url to its internal list of which kinds of urls
it can rewrite, and make a decision.

> Not false-reporting a 25% failure rate for rewriting resources.

"Resources not rewritten because domain wasn't authorized" is a
statistic that's trying to cover exactly this case, where there are
resources mentioned in your html that PageSpeed doesn't have the
authority to rewrite. People often care about this statistic because
it commonly indicates that there are urls on something like a cdn that
could be optimized if PageSpeed's configuration were tweaked. While
in your situation, where the only cases it sees are 3rd-party
resources you have decided you want to keep including, it's not
telling you something useful, it's often useful for other people.

Jeff

David Hunt

unread,
Sep 29, 2016, 8:17:16 AM9/29/16
to mod-pagespeed-discuss
By messages, I mean what appears when I visit /pagespeed_admin/message_history

So it looks like I should pay attention to unexpected changes in the "resources not rewritten" rate, rather than worry that it's non-zero.

Jeff Kaufman

unread,
Sep 29, 2016, 8:24:30 AM9/29/16
to mod-pagespeed-discuss
On Thu, Sep 29, 2016 at 8:17 AM, David Hunt <davi...@gmail.com> wrote:
> By messages, I mean what appears when I visit
> /pagespeed_admin/message_history

Ok, that's what's supposed to be happening. The idea is that when
someone visits /pagespeed_admin/message_history they're probably
debugging something, and so would like to see relatively low level or
minor notifications.

> So it looks like I should pay attention to unexpected changes in the
> "resources not rewritten" rate, rather than worry that it's non-zero.

Yes, that makes sense. In your case it's fine that it's non-zero.

The situation in which this metric would go up and would actually
indicate a problem is one where you add a cdn or other domain under
your control and don't give PageSpeed permission to optimize those
resources.

Jeff
Reply all
Reply to author
Forward
0 new messages