? Success

User tests: Successful: Unsuccessful:

avatar Chraneco
Chraneco
15 May 2015

The setting of headers like 'Content-Type' is currently happening in method respond of class JApplicationWeb.

Unfortunately, the system cache plugin stores contents at event onAfterRender which is triggered before respond is executed. Therefore, certain headers are missing when serving from the cache.
This creates problems especially if we are serving content that is not of Content-Type text/html.

This pull request changes the plugin so that the cache is created only after these headers are set by using event onAfterRespond instead of onAfterRender.

Since gzip compression already happened at this point, the compressed contents are stored in the cache and therefore no further compression is necessary when serving cached contents. Thus, the second change in the plugin file.

For testing please make sure that everything works as before and check that the Content-Type header is also cached now.

Testing Instructions

  1. Install attached cache test component and access it in frontend (there's no backend part).
  2. Click on the presented link which takes you to an image which should be displayed fine (even after refreshing the page).
  3. Enable the cache plugin of Joomla! and ensure that debug mode is disabled and you aren't logged in in frontend.
  4. Refresh the page of the image a few times. => It won't be displayed correctly anymore.
  5. Apply the patch, clear the cache and do the same again => the image will be displayed even after refreshing.
avatar Chraneco Chraneco - open - 15 May 2015
avatar Chraneco Chraneco - change - 15 May 2015
The description was changed
avatar zero-24 zero-24 - change - 15 May 2015
Status New Pending
Easy No Yes
avatar zero-24 zero-24 - change - 15 May 2015
Category Cache
avatar zero-24 zero-24 - change - 15 May 2015
Labels Added: ?
avatar RickR2H
RickR2H - comment - 11 Jul 2015

hello @Chraneco

Thank you for your contribution.

Please provide clear test instructions to be able to test / reproduce this issue.
If no reply is received within 4 weeks we will close this issue.

Thanks for understanding!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6955.

avatar RickR2H RickR2H - test_item - 11 Jul 2015 - Not tested
avatar Chraneco Chraneco - change - 11 Aug 2015
The description was changed
avatar Chraneco Chraneco - change - 11 Aug 2015
The description was changed
avatar Chraneco
Chraneco - comment - 11 Aug 2015

Yes, I added instructions above.

Unfortunately, it doesn't seem to be possible to add extensions archives as attachments here, so I added an issue on Joomlacode and attached the test component there:
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=34149&start=0


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6955.

avatar RickR2H
RickR2H - comment - 17 Aug 2015

@Chraneco I tried the component but initially the image wouldn't show. I do get the link but when I click it I get an empty page... Hope you can fix the component. You can mail me component directly: rick@r2h.nl
afbeelding 4

avatar Chraneco
Chraneco - comment - 20 Aug 2015

@RickR2H Sorry, the sample image in Joomla I was using was apparently deleted in one of the latest versions. I updated the component with a path to another image and sent it to your email address.

If it still doesn't work please check whether the image images/sampledata/fruitshop/apple.jpg exists in your Joomla installation (it's there in a fresh new instance).

Thanks for testing!

avatar RickR2H RickR2H - test_item - 20 Aug 2015 - Tested successfully
avatar RickR2H
RickR2H - comment - 20 Aug 2015

Patch works! Thanks @Chraneco for putting all the effort in making a component to test this PR.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6955.

avatar RichardR2H RichardR2H - test_item - 20 Aug 2015 - Tested successfully
avatar RichardR2H
RichardR2H - comment - 20 Aug 2015

Works here! Thanks.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6955.

avatar zero-24 zero-24 - change - 23 Aug 2015
Status Pending Ready to Commit
avatar zero-24
zero-24 - comment - 23 Aug 2015

RTC based on tests by @RickR2H and @RichardR2H.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6955.

avatar joomla-cms-bot joomla-cms-bot - change - 23 Aug 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 25 Aug 2015
avatar Kubik-Rubik Kubik-Rubik - change - 3 Sep 2015
Milestone Added:
avatar Kubik-Rubik Kubik-Rubik - change - 3 Sep 2015
Milestone Removed:
avatar roland-d roland-d - reference | 44d22db - 9 Sep 15
avatar roland-d roland-d - merge - 9 Sep 2015
avatar roland-d roland-d - close - 9 Sep 2015
avatar roland-d roland-d - change - 9 Sep 2015
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2015-09-09 03:09:43
Closed_By roland-d
avatar roland-d roland-d - close - 9 Sep 2015
avatar joomla-cms-bot joomla-cms-bot - close - 9 Sep 2015
avatar joomla-cms-bot joomla-cms-bot - change - 9 Sep 2015
Labels Removed: ?
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone Added:
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone Added:
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone

Add a Comment

Login with GitHub to post a comment