Search code examples
amp-html

Problems when update AMP cache


According to the Update AMP Cache, a URL with in

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

form should be generated. It uses a question mark ? symbol to separate the path and parameter behind example.com/article?amp_action=

Now I want to update a url

https://m.discuss.com.hk/amp_viewthread.php?tid=24025060. 

It has a question mark at the end of the URL. Thus, how to construct the URL here?

Should I generate it as:

…update-cache/c/s/m.discuss.com.hk/amp_viewthread.php?tid=24025060&amp_action=flush…

Or something like:

…update-cache/c/s/m.discuss.com.hk/amp_viewthread.php%3ftid=24025060?amp_action=flush…

Solution

  • You can use URL query string parameters in the AMP URL, see https://developers.google.com/amp/cache/overview#query-parameter-example

    You should be able to mix your original query parameters in with the update-cache parameters. Check the github discussion here

    So your update url will be

    …update-cache/c/s/m.discuss.com.hk/amp_viewthread.php?tid=24025060&amp_action=flush…