Hot answers tagged

76

The image URL that you've given is impossible to have with a Magento store. I'm guessing you wanted it to be obfuscated, but in doing so have made it impossible to answer. I can't think of any reasons to de-construct the image path unless you are web-scraping another website, otherwise, you would have direct access to the product model and could fetch this ...


49

TL; DR - On MageStack we use Varnish, Redis (cache), Redis (sessions) and Eaccelerator/Zend OPCache (depending on PHP version) You've already got most of it understood. The cache backend, session store, opcode cache, full page cached and reverse proxy cache are all completely different. You can use different technologies for all and you can use them ALL ...


47

I have resolved the issue by myself with the following solution: Login to your server and run the below command from your magento root directory: php -r 'require "app/Mage.php"; Mage::app()->getCacheInstance()->flush();' Above command flush your magento 1 cache. I suggest when change magento project folder then run above command


41

If you really wanted to you could also clean just one or more cache types. This is actually how the admin section does it. Under Mage_Adminhtml_CacheController::massRefreshAction You can see that it loops through all the parameters types and calls the following $tags = Mage::app()->getCacheInstance()->cleanType($type); Mage::dispatchEvent('...


39

One way of dealing with this is enabling merging of CSS. Then you could just clear the cache and a new merged file would be created with a new file name. System -> Configuration -> Developer -> CSS settings -> Merge CSS Files As far as I know, the hash code of the merged CSS file stays the same even if the underlying files changed - ...


35

To purge out-of-date items from the cache, you can clean or flush cache types: Cleaning a cache type deletes all items from enabled Magento cache types only. In other words, this option does not affect other processes or applications because it cleans only the cache that Magento uses. Disabled cache types are not cleaned. Flushing a cache type purges the ...


34

That error comes up when a module does not correctly declare its commands. It just stops Magento from correctly reading the wole commands list. Unless you have broken third party modules, you probably have something left in your cache or generation folder preventing you to correctly run Magento commands. From your Magento root: rm -Rf var/cache/* rm -Rf ...


33

You can try <reference name="needed block"> <action method="setCacheLifetime"><s>null</s></action> </reference> or <reference name="needed block"> <action method="setCacheLifetime" /> </reference> to set it to null. But probably it is better to use ajax. There is a ...


33

Blocks can be set as non-cacheable by setting the cacheable attribute false in layout XML files. For example <block class="Block\Class" name="blockname" cacheable="false" /> Pages containing such blocks are not cached. Also check How do disable caching of custom block Edit: A single cacheable="false" will disable Full Page Caching for the whole ...


28

There are two difficult things in computer science: Naming things Cache invalidation. Hole punching falls into category #2 :) General The best approach is to start at the lower points of the stack and optimize up to the frontend of Magento. Database and Filesystem Should always be the first areas to focus on. Because. I/O. MyTop is a handy Linux ...


26

You need to understand the clear distinction between these two products to understand how to use them. APC is both an OPCode Cache and Fast Backend Memcache is just a Fast Backend Using APC as an OPCode Cache Simply install the module on your server pecl install apc And enable it in your php.ini echo "extension=apc.so" >> /usr/lib/local/...


25

Please try the following code to flush the cache programatically Mage::app()->cleanCache() or Mage::app()->getCacheInstance()->flush();


22

We just don't - at all. Ever. We'll say this over and over again but Caching != Performance Your site needs to be fast without the addition of FPC (or Varnish for that fact). There is always going to be a time when the content isn't primed (your scenario above). On an unloaded store, page load times with FPC shouldn't be that much more impressive than non-...


22

The below code programmatically flushes cache. It worked fine for me. Case 1: Outside Magento use Magento\Framework\App\Bootstrap; include('../app/bootstrap.php'); $bootstrap = Bootstrap::create(BP, $_SERVER); $objectManager = $bootstrap->getObjectManager(); try{ $_cacheTypeList = $objectManager->create('Magento\Framework\App\Cache\...


21

Redis is supported in Magento 1.13 out of box - it is also a direct port of Colin's CE-compatible module. The below is adapted from Colin's Github for Cm_Cache_Backend_Redis, edited for the class names in Enterprise 1.13. This is how you would configure: <!-- This is a child node of config/global --> <cache> <backend>...


20

Flush Magento Cache - This clears the cache (var/cache) of any items that Magento knows it has created. Flush Cache Storage - Clears everything in var/cache, regardless of how those files in there were created. So, if you want to be safe you're clearing everything, you may choose "Flush Cache Storage" which will essentially clear out var/cache. For the ...


19

You can use the OpenSource Module Aoe_JsCssTstamp which adds timestamp information to the merged CSS files. Timestamps for plain (un-merged) CSS files are not yet supported however but this would be easy to implement.


19

Is Varnish right for you? Varnish isn't the be-all and end-all of Magento performance. Its great to offset load from bots & window-shoppers - but it shouldn't be your first port of call to actually making your store faster. In fact, implementing Varnish should be the last performance modification to your store. Only drop it in once you are seeing the ...


19

This is below some basic structure for create custom cache type, create one module with, app/code/Vendor/Cachetype/etc/cache.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Cache/etc/cache.xsd"> <type name="custom_cache" translate="label,...


18

I think right way to refresh .less files now it's php bin/magento setup:static-content:deploy Because it "Collects, processes and publishes source LESS files" Another point it's use dev mode during development then according to documentation "Static view files are not cached; they are written to the Magento pub/static directory every time they’re called" ...


17

Hardcoding the types is a bad idea. Instead you can use the same method used by the cache:flush and cache:clean commands. The cache manager class can also pull all the cache types for you, as done in the example below. public function __construct( \Magento\Framework\App\Cache\Manager $cacheManager ) { $this->cacheManager = $cacheManager; } ...


17

It's important to understand why you don't want to cache block. If this is meant to show some session specific information then you should be looking into http://devdocs.magento.com/guides/v2.1/config-guide/cache/cache-priv-priv.html One non-recommended option could be also custom controller what returns some data over ajax-call (with POST-method so it ...


17

$ bin/magento module:enable --all


17

This looks like a known issue: This does happen from time to time on the project I'm working on, but I wasn't able to find the steps to reproduce. All I can say is that it happens during a deployment process. All I could find is that under certain circumstances a file .regenerate is written in the var folder (either at setup upgrade or composer install / ...


16

You could use siege in combination with the sitemap.xml file, like MageSpeedTest does. #categories curl http://yourmagentostore.com/sitemap.xml | sed 's/\<url\>/\<url\>\n/g' | grep 0.5 | sed 's/.*loc>\(.*\)<\/loc.*/\1/g' > urls.txt #products curl http://yourmagentostore.com/sitemap.xml | sed 's/\<url\>/\<url\>\n/g' | grep 1....


16

After some digging around and some useful feedback on twitter I appear to have found some stuff out. By default this is set-up to use a Zend Server feature Page Cache. It appears to be a feature almost completely set-up on the server with the only things in Magento being. A clean function that calls. page_cache_remove_all_cached_contents public function ...


16

go to database and execute this query SELECT * FROM core_config_data WHERE path LIKE 'dev%' change these value from 1 to 0 dev/js/merge_files dev/css/merge_css_files


15

Magento cache is no different. Starting off with the basics, cache options can be viewed by navigating to System->Cache Management in the backend. You can see the different areas of caching that can be enabled/disabled, such as any configurations, layout.xml, blocks, full page, and api files. Obviously the ideal is to have all of these enabled once the ...


15

Could also be you are using a different cache storage like memcached, Redis


15

This issue is still reproducible on Magento 2.0.0 Stable. There is a feature in Magento 2 exception handling, which prevents rendering of broken blocks while all other blocks are still rendered. In developer mode it is disabled and all exceptions are displayed right in browser. In default and production modes, if exception occurs during block rendering, the ...


Only top voted, non community-wiki answers of a minimum length are eligible