Hi,
When purging the frontpage (e.g, without pathname) there is an extra slash at the end of the path. So for example, instead of purging http://mysitetest.devcloud.acquia-sites.com/fi, it tries to purge http://mysitetest.devcloud.acquia-sites.com/fi/ instead. This is wrong because normally there is no extra slash at the end of the path and therefore the expected path is still served from cache. I attached a simple patch for this.
| Comment | File | Size | Author |
|---|---|---|---|
| acquia-purge-extra-slash.patch | 640 bytes | ngocketit |
Comments
Comment #1
nielsvm commentedHi ngocketit,
I tried testing this on the 7.x-1.x branch but honestly, my behavior was not the same as yours:
But, there's something wrong here indeed as Acquia Purge - which is both API + expire glue - should in fact not strip that ending /, because it still is a valid URL. Varnish will cache
http://mysite.com/fiandhttp://mysite.com/fi/as two different objects so purging the latter should not lead in a purge to the first URL.As my current code was already stripping that - as seen above - I decided to strip this out of the core API's
_acquia_purge_input_clean()function, which now does all the generic input cleaning. So with that change you can now in fact purge two different URLs exactly as you are giving them:But to accommodate your problem described above, it will now right-strip slashes when they originate from the Expire module as Drupal generated links will never refer to paths with slashes on the end so whenever Expire would provide us one to purge, we can safely remove it. The following example illustrates the new behavior (notice that
expire-pathis provided by Expire itself):As you can see, the ending slash is gone here, so to answer your first sentence:
From version 7.x-1.0 - that's due for release in 1-2 weeks - it will still purge that outer slash if you are using
drush ap-purge, the rule action 'Purge a path from Varnish on Acquia Cloud' or the Acquia Purge API functionacquia_purge_purge_paths()directly. But it will strip that slash if it comes through expire.Comment #2
nielsvm commentedPlease see https://www.drupal.org/node/2322017#comment-9101035, which is a new (+related) feature that ends up in the module as well.