WPIntell

Source evidence

Issue with FlyingPress Cache and optimization

Specific Content For Mobile – Customize the mobile version without redirections · support · 2024-10-15T19:46:00+00:00

complaintsentiment
mediumseverity
0.93relevance
4replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

7 / 33 rows with source links

21.2% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

26 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
trivelo unresolved
Hello Team, I’m having an unusual issue with the FlyingPress plugin ( https://flyingpress.com/ ). For some reason, the mobile version of the site is displaying the desktop version instead. We’ve configured the settings to create a separate cache for mobile, including the query string scfm-mobile , but it doesn’t seem to be working as expected. Interestingly, when I clear the cache, everything displays correctly, but after a few refreshes, the desktop version appears on mobile again. Could this be a compatibility issue? I am also using Cloudflare Enterprise, which includes cache preloading. Any ideas or suggestions on what might be causing this would be greatly appreciated. The page I need help with: [ log in to see the link] Seems it is issue with FlyingPress plugin, their team is working to resolve it. Hi @bufisys thank you for reporting this issue. Let me know if they have any questions about the plugin. Have a great day! Jose Hi Jose, It seems that FlyingPress and FlyingCDN are not compatible with this plugin, due that FlyingCDN doesn’t generate a separate cache for mobile devices. I resolved this by adding to header below Javascript. Hope it help someone else who uses same. <script type="text/javascript"> // Run the redirection check as soon as possible (function() { // Simple mobile detection var isMobile = window.innerWidth <= 768 || /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); if (isMobile) { // Check if 'scfm-mobile=1' is already in the URL if (window.location.href.indexOf('scfm-mobile=1') === -1) { // Append '?scfm-mobile=1' to the current URL var newUrl = window.location.href + (window.location.href.indexOf('?') === -1 ? '?' : '&') + 'scfm-mobile=1'; // Redirect before loading other resources window.location.replace(newUrl); } } })(); </script> All needed to be done afterwards is to ensure that they cache that query string. Hi @bufisys thank you for the information and for your solution. Theoretically, you don’t need that script. You should find this in your .htaccess file: # BEGIN Specific Content For Mobile <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_USER_AGENT} Mobile|Android|Silk/|Kindle|BlackBerry|Opera\ Mini|Opera\ Mobi [NC] RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{QUERY_STRING} !scfm-mobile RewriteCond %{QUERY_STRING} !wc-ajax RewriteCond %{QUERY_STRING} !^$ RewriteCond %{REQUEST_URI} !\. RewriteRule ^(.*)$ %{REQUEST_SCHEME}://%{HTTP_HOST}%{REQUEST_URI}\?%{QUERY_STRING}\&scfm-mobile=1 [L,NS,R=301] RewriteCond %{HTTP_USER_AGENT} Mobile|Android|Silk/|Kindle|BlackBerry|Opera\ Mini|Opera\ Mobi [NC] RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{QUERY_STRING} !scfm-mobile RewriteCond %{QUERY_STRING} !wc-ajax RewriteCond %{QUERY_STRING} ^$ RewriteCond %{REQUEST_URI} !\. RewriteRule ^(.*)$ %{REQUEST_SCHEME}://%{HTTP_HOST}%{REQUEST_URI}\?scfm-mobile=1 [L,NS,R=301] </IfModule> # END Specific Content For Mobile The code above is added by SCFM to add exactly the query string you are adding via JavaScript. If the redirect is done from the .htaccess file, it will consume practically zero. On the contrary, if you do it via JavaScript, PHP + MySql have to run before building the page, then the page is sent to the browser, and only when the browser parses your script you have the redirect. This is bad for performance. You should check your .htaccess file, and if you don’t find the code described above, we should try to understand why you don’t have it. If you don’t find that code, I suggest you: Be sure you have the latest version of Specific Content For Mobile Disable and enable again (without removing it because you would lose the settings) Specific Content For Mobile Visit the backend page Settings => Permalinks Check again the file .htaccess Delete the browser cache Delete the FlyingPress and FlyingCDN cache Please, let me know if you can see that code in your .htaccess file. Have a great day! Jose

Comments

4 shown
trivelo 2024-10-15T20:37:00+00:00

Seems it is issue with FlyingPress plugin, their team is working to resolve it.

Jose Mortellaro 2024-10-16T07:58:00+00:00

Hi @bufisys thank you for reporting this issue. Let me know if they have any questions about the plugin. Have a great day! Jose

trivelo 2024-10-17T12:47:00+00:00

Hi Jose, It seems that FlyingPress and FlyingCDN are not compatible with this plugin, due that FlyingCDN doesn’t generate a separate cache for mobile devices. I resolved this by adding to header below Javascript. Hope it help someone else who uses same. <script type="text/javascript"> // Run the redirection check as soon as possible (function() { // Simple mobile detection var isMobile = window.innerWidth <= 768 || /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); if (isMobile) { // Check if 'scfm-mobile=1' is already in the URL if (window.location.href.indexOf('scfm-mobile=1') === -1) { // Append '?scfm-mobile=1' to the current URL var newUrl = window.location.href + (window.location.href.indexOf('?') === -1 ? '?' : '&') + 'scfm-mobile=1'; // Redirect before loading other resources window.location.replace(newUrl); } } })(); </script> All needed to be done afterwards is to ensure that they cache that query string.

Jose Mortellaro 2024-10-17T14:47:00+00:00

Hi @bufisys thank you for the information and for your solution. Theoretically, you don’t need that script. You should find this in your .htaccess file: # BEGIN Specific Content For Mobile <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_USER_AGENT} Mobile|Android|Silk/|Kindle|BlackBerry|Opera\ Mini|Opera\ Mobi [NC] RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{QUERY_STRING} !scfm-mobile RewriteCond %{QUERY_STRING} !wc-ajax RewriteCond %{QUERY_STRING} !^$ RewriteCond %{REQUEST_URI} !\. RewriteRule ^(.*)$ %{REQUEST_SCHEME}://%{HTTP_HOST}%{REQUEST_URI}\?%{QUERY_STRING}\&scfm-mobile=1 [L,NS,R=301] RewriteCond %{HTTP_USER_AGENT} Mobile|Android|Silk/|Kindle|BlackBerry|Opera\ Mini|Opera\ Mobi [NC] RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{QUERY_STRING} !scfm-mobile RewriteCond %{QUERY_STRING} !wc-ajax RewriteCond %{QUERY_STRING} ^$ RewriteCond %{REQUEST_URI} !\. RewriteRule ^(.*)$ %{REQUEST_SCHEME}://%{HTTP_HOST}%{REQUEST_URI}\?scfm-mobile=1 [L,NS,R=301] </IfModule> # END Specific Content For Mobile The code above is added by SCFM to add exactly the query string you are adding via JavaScript. If the redirect is done from the .htaccess file, it will consume practically zero. On the contrary, if you do it via JavaScript, PHP + MySql have to run before building the page, then the page is sent to the browser, and only when the browser parses your script you have the redirect. This is bad for performance. You should check your .htaccess file, and if you don’t find the code described above, we should try to understand why you don’t have it. If you don’t find that code, I suggest you: Be sure you have the latest version of Specific Content For Mobile Disable and enable again (without removing it because you would lose the settings) Specific Content For Mobile Visit the backend page Settings => Permalinks Check again the file .htaccess Delete the browser cache Delete the FlyingPress and FlyingCDN cache Please, let me know if you can see that code in your .htaccess file. Have a great day! Jose