Silverstripe Version: 3.7.3
Question:
Hi all, it seems to me that partial caching does not cache requirements. Consider the following code:
Page.ss, somewhere in HTML body:
<% cached 'cache key here' %>
<% require javascript('themes/mytheme/javascript/test.js') %>
<% end_cached %>
test.js:
alert('TESTING');
Now if you test this in browser, you will notice that you will get an alert popup box saying ‘TESTING’. Then try to reload the same page again and it does not alert anything. This is because the JavaScript file is not included anymore, because SilverStripe caching does not store requirements - if I have understood correctly.
Does this same happen on SilverStripe 4? I haven’t tested it, but I’m asking if someone else knows.
Sorry, I’m in a little bit hurry, so I have to leave now. I will submit more information later if needed or edit this post is it’s unclear.
Thank you for your support!