Issue with AMP for WP
-
I have installed AMP for WP – Accelerated Mobile Pages (https://fr.ww.wp.xz.cn/plugins/accelerated-mobile-pages/) in order to create AMP pages for mobiles on my website
All pages with normal url + /amp give the amp version.
But it fails with WP Super Cache. AMP pages are here but the menu, the icons are not here and propose strange artefacts (same for the social buttons – you dont see the icons). I tried to disable/enable mobile support in WP Super Cache , play with rejected user agents (i put all mobile stuff inside) or rejected string like /amp* /amp but nothing work.
It only works perfectly when i disable WP Super cache.
Accelerated Mobile Pages give an extension ‘Plugin Manager’ in order to disable the plugin you want for amp page. I disable Super Cache but it has no impact.
Anyone can help me to find a solution. I am ready to disable wp super cache for my amp version (if no solution) but want to keep it for the normal (desktop version) one. Thank you for your help
-
I got more info. This is the wp super cache cdn which provokes an issue with a font (only difference on the page) :
wp super cache disabled :
@font-face {font-family: ‘icomoon’;font-style: normal;font-weight: normal;src: local(‘icomoon’), local(‘icomoon’), url(‘https://www.mysite.com/wp-content/plugins/accelerated-mobile-pages/templates/design-manager/swift/fonts/icomoon.ttf‘);}
wp super cache enabled :
@font-face {font-family: ‘icomoon’;font-style: normal;font-weight: normal;src: local(‘icomoon’), local(‘icomoon’), url(‘https://s2.mysite.com/wp-content/plugins/accelerated-mobile-pages/templates/design-manager/swift/fonts/icomoon.ttf‘);}
for info : i’ve checked both links and they are accessible.
Any idea how to solve this kind of issue without disabling cdn?
I think that WPSC can’t be disabled on this way because WPSC files are loaded before plugin AMP for WP. Also /amp is endpoint and rejected string should be
*/ampor you can set constantDONOTCACHEPAGEsomewhere in the code ( example: you can use action template_redirect where it’s possible to detect page type and set this constant).Related to CDN, you can set exclude in CDN settings ( example:
.php,icomoon). It should skip rewriting for this font.It seems as CORS issue and you can try:
https://www.maxcdn.com/one/tutorial/how-to-use-cdn-with-webfonts/
https://www.keycdn.com/blog/cors-cdn/You could see is it CORS issue in browser console:
https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/ErrorsI hope that helps.
Thank you Sasa,
I have rejected the uri : ‘icomoon’ in the WPSC CDN and this is ok. Not a big deal to not use the CDN here, so I will keep like this as I can use WPSC on AMP pages now.
Hi,
I don’t know if this is related to the same concern by Veda (@veda). I have experienced the search icon on the site turn into a “U” and the play button turn into the letter “I”.
Is there a way to fix that?
Thanks.
The topic ‘Issue with AMP for WP’ is closed to new replies.