You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enable the cache (it does not matter which engine, I tested with redis and file caching). Do not use the Page caching plugin.
The easiest way with an out-of-the-box J!4 installation...
The vcf download of a contact has an extra added header Content-disposition with the card_name in the file name. For example attachment; filename="John Smith.vcf"
Expected result
The Content-disposition: attachment; filename="John Smith.vcf" header is always present. Also when delivering a cached version.
Actual result
The Content-disposition: attachment; filename="John Smith.vcf" header is only present the first time the vcf is loaded. With the cached version this header disappeared.
System information (as much as possible)
Joomla! 4.0.0-rc6 Release Candidate
php-fpm
nginx
Additional comments
As I said this header is just an example. You could also test it by adding this code to a view you want to test:
if (isset($options['headers']) && $options['headers'])
When I force this if-clause to be true (change it to if(true)) the header is being stored. I don't think this is the solution, but it might help finding the good solution. I hope this find might help someone with more knowledge of the Caching layer to solve the problem.
In J!3.9 it all works perfectly. I tried to compare the J!4 code with it, but did not get my head around it.
@PhilETaylor , in my first comment I stated this works perfectly for J!3.9 (J!3.10) but I was mistaken. It doesn't work there either.
I've found a work around for this issue and using the page cache plugin on top of it prevents it from happening as it seems. So not a big priority I think.
Though it looks a bit strange to me that by activating the cache (and not the page cache) custom component headers are only sent when there is a cache miss.
Steps to reproduce the issue
Enable the cache (it does not matter which engine, I tested with redis and file caching). Do not use the Page caching plugin.
The easiest way with an out-of-the-box J!4 installation...
The vcf download of a contact has an extra added header
Content-disposition
with the card_name in the file name. For exampleattachment; filename="John Smith.vcf"
Expected result
The
Content-disposition: attachment; filename="John Smith.vcf"
header is always present. Also when delivering a cached version.Actual result
The
Content-disposition: attachment; filename="John Smith.vcf"
header is only present the first time the vcf is loaded. With the cached version this header disappeared.System information (as much as possible)
Additional comments
As I said this header is just an example. You could also test it by adding this code to a view you want to test:
The text was updated successfully, but these errors were encountered: