Commit c4a73d9e authored by Kevin Yumang's avatar Kevin Yumang

speedimprovement phase 1

parent b947cd72
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
| Class "AssetHelper" | Class "AssetHelper"
|------------------------------------------------------------------------------------------------ |------------------------------------------------------------------------------------------------
*/ */
class AssetHelper class AssetHelper
{ {
/* /*
...@@ -55,6 +55,13 @@ ...@@ -55,6 +55,13 @@
*/ */
if (isset($configCls->assetAllocation) && isset($configCls->assetAllocation[$currentKey])) if (isset($configCls->assetAllocation) && isset($configCls->assetAllocation[$currentKey]))
{ {
/*
|--------------------------------------------------------------------------------
| Start the ResourcePublisherManager for getting the mimetype within the loop.
*/
$RP = new ResourcePublisherManager();
Please register or sign in to reply
/* /*
|------------------------------------------------------------------------------------ |------------------------------------------------------------------------------------
| Loop all available assets. | Loop all available assets.
...@@ -93,7 +100,6 @@ ...@@ -93,7 +100,6 @@
|-------------------------------------------------------------------------------- |--------------------------------------------------------------------------------
| Get the correct mimetype of the source. | Get the correct mimetype of the source.
*/ */
$RP = new ResourcePublisherManager();
$mime = $RP->getMime($path); $mime = $RP->getMime($path);
/* /*
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
|------------------------------------------------------------------------------------------------ |------------------------------------------------------------------------------------------------
*/ */
use Response; use Response;
use Cache;
/* /*
...@@ -29,7 +30,7 @@ ...@@ -29,7 +30,7 @@
| Class "ResourcePublisherManager" | Class "ResourcePublisherManager"
|------------------------------------------------------------------------------------------------ |------------------------------------------------------------------------------------------------
*/ */
class ResourcePublisherManager class ResourcePublisherManager
{ {
/* /*
...@@ -124,8 +125,9 @@ ...@@ -124,8 +125,9 @@
*/ */
public function getMime($filePathOrUrl) public function getMime($filePathOrUrl)
{ {
return $this->renderFilePath($filePathOrUrl, true); return Cache::rememberForever('ResourcePublisherManagergetMime'.$filePathOrUrl, function () use ($filePathOrUrl) {
Please register or sign in to reply
return $this->renderFilePath($filePathOrUrl, true);
});
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment