Amphtml: "update-cache request" docs: What if the AMP doc URL itself has parameters?

Created on 11 Aug 2017  路  13Comments  路  Source: ampproject/amphtml

Malte asked me to file an issue to explain the problem more verbose.

The AMP documentation on update-cache request says to construct an URL as follows:

https://example-com.<cache.updateCacheApiDomainSuffix>/update-cache/c/s/example.com/article?amp_action=flush&amp_ts=<ts_val>&amp_url_signature=<sig_val>

In this example, the substring "example.com/article" is essentially the article URL (minus "https://"). URL-encoding the article URL does not seem to be required (not mentioned in the docs and not visible in the example either since the / is obviously unencoded).

But what if my AMP article URL is not "example.com/article" but "example.com/article?amp=1" (where "example.com/article" is the non-AMP version)? What should the generated URL look like?

Will the AMP cache somehow notice that in the following example ?amp=1 is part of the article URL and not a superfluous parameter passed to the "update-cache" endpoint?
https://example-com.<cache.updateCacheApiDomainSuffix>/update-cache/c/s/example.com/article?amp=1&amp_action=flush&amp_ts=<ts_val>&amp_url_signature=<sig_val>?

I think the clean solution would be to urlencode the article URL.

caching

All 13 comments

/to @Gregable

This issue seems to be in Pending Triage for awhile. @Gregable Please triage this to an appropriate milestone.

This issue seems to be in Pending Triage for awhile. @Gregable Please triage this to an appropriate milestone.

This issue seems to be in Pending Triage for awhile. @Gregable Please triage this to an appropriate milestone.

Closing bug as this is an AMP Cache specific. That project is tracking internally at b/113542032

Is there a way for me to be notified if/when this issue is resolved?

Since the issue is being tracked internally we will not be able to provide regular updates, but feel free to reply to this github issue or ping us on slack for more updates.

@Gregable Do you have news about this issue with "update-cache" requests? We've continued using the old "update-ping" requests but they have stopped working today (404 response). So there is currently no way for us to ping AMP caches about updated URLs.

Let's keep this open until the internal bug is fixed.

@steffenweber It appears that, yes, you should be able to mix your original query parameters in with the update-cache parameters. If any of them share the same name, make sure the original values appear after the update-cache values, like ?amp_ts=<the value update-cache uses>&amp_ts=<your original value>. I'm not sure what happens if your original URL has some unusual query serialization like ?blah&&amp_ts=2 -- this nuance might get lost by the URL parser & reserializer.

@steffenweber Yes, that's correct.

My understanding is that the original question was answered and we can close this bug. Please respond if you think there is something more to do here.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

devanes picture devanes  路  3Comments

edhollinghurst picture edhollinghurst  路  3Comments

Download picture Download  路  3Comments

radiovisual picture radiovisual  路  3Comments

choumx picture choumx  路  3Comments