User tests: Successful: Unsuccessful:
closed #6997 in favor of this one. Started all over again.
problem: Joomla! makes no difference in devices when caching a page.
This pull request makes an end to it and adds a prefix to the cache ID.
This pull request uses the Joomla! default browser detection implementation.
To test this PR you have to create a template override with platform specific code in it. For example an override on com_content article.
Example code:
jimport('joomla.application.web.client');
$webclient = new JApplicationWebClient();
if ($webclient->mobile)
{
echo 'Joomla! rocks';
}
On mobile you will see the text "Joomla! rocks"
The same page on desktop or tablet you will not see the text "Joomla! rocks".
before this patch && caching enabled:
after this patch && caching enabled:
With this PR you can create platform specific pages AND use cache. (dance)
Special thanks to @roland-d for helping me with this pr
Status | New | ⇒ | Pending |
Labels |
Added:
?
?
|
Rel_Number | 0 | ⇒ | 6997 |
Relation Type | ⇒ | Related to |
Milestone |
Added: |
Category | ⇒ | Cache Libraries |
Easy | No | ⇒ | Yes |
This PR has received new commits.
CC: @n9iels
@test successful
In Global Configuration I've enabled Conservative Cache.
I've created a template override /templates/protostar/html/com_content/article/default.php with the following code:
<?php
jimport('joomla.application.web.client');
$webclient = new JApplicationWebClient();
if ($webclient->mobile)
{
echo 'Joomla! mobile rocks';
}else{
echo 'Joomla! desktop rocks';
}
?>
After applying the patch the same issue occurred: if I first visit the page with mobile phone, then the desktop will also see "Joomla! mobile rocks". After setting "Platform specific caching" to "Yes" and emptying Joomla's cache, the desktop showed 'Joomla! desktop rocks' and the mobile displayed 'Joomla! mobile rocks'.
Not that I had to use Google Chrome Inspector > Inspect Element > click on the mobile phone & select a device to properly display 'Joomla! mobile rocks'. Just re-sizing the browser to mobile phone size did not work.
I have tested this item successfully on 556c98a
I've tested this PR successfully but because I used github, the system does not see it as tested.
Therefore I've resubmitted my successful test report http://issues.joomla.org/tracker/joomla-cms/8055#event-104374 via issues.joomla.org
I have tested this item successfully on 556c98a
Worked perfectly
Status | Pending | ⇒ | Ready to Commit |
RTC for 3.5 thanks
Labels |
Added:
?
|
Milestone |
Added: |
Milestone |
Removed: |
Milestone |
Added: |
Milestone |
Removed: |
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-10-17 11:37:26 |
Closed_By | ⇒ | roland-d |
Labels |
Removed:
?
|
a) Has this been tested with the (system) page cache plugin?
b) If the browser detection is being done with PHP (which I assume it is, since you can the J API), you understand that this will have no effect when used with a reverse caching proxy like Varnish, right? Or any caching in front of Joomla, e.g. Nginx's FastCGI caching for PHP5-FPM.
@fevangelou A little late ;)
I don't remember if this has been tested with the page cache plugin.
If it has no effect than at least it works as it used to work before, feel free to post a pull request that deals with those cases as well. By default this option is turned off.
I have tested this item successfully on 8c1c750
After enabled the parameter "Platform specific caching" in the Joomla! configuration, the patch works fine for me. Please add this step to the test instructions :)
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8055.