Blog

Magento latest News, Update, Tutorials and much more

Static files are files generated by Magento to load pages faster, so it does not need to complete all necessary computations on every page. Magento computes them once and stores them as Static Files Cache.

In some cases you might need to regenerate those files in order for last theme changes to get applied.

In order to deploy static files you have to:

  1. Log in to the Magento server as the Magento file system owner.
  2. Delete the contents of <your Magento install dir>/pub/static using command:
    rm -R pub/static/*
  3. Run this command:
    magento setup:static-content:deploy -f

It is possible that magento command is not handled properly, in that case you should run this command instead:

php bin/magento setup:static-content:deploy

You can read more about how to regenerate Magento Static Files Cache in Magento DevDocs

 

Static files are files generated by Magento to load pages faster, so it does not need to complete all necessary computations on every page. Magento computes them once and stores them as Static Files Cache.

Sometimes applying new theme requires you to manually clear Static Files and force Magento to regenerate static files with new theme applied.

There are few ways to regenerate Static files, it's enough to run one of them successfully:

  1. Go to Magento Admin panel > System > Tools > Cache Management and click Flush Static Files Cache (This option is only availble in developer mode).
  2. Go to Magento root folder using FTP or any other remote file manager and clear the pub/static and var/view_preprocessed directories and subdirectories. Just make sure you don't delete pub/static/.htaccess file.
  3. You can clear static files using a command line, enter this command while you are in a root Magento folder:
    rm -R pub/static/*

This will remove all static files except pub/static/.htaccess file which you should not delete.

You can read more about how to Clear Static Files in Magento in Magento DevDocs.

 

Sometimes your changes do not appear on your Magento website right away. Sometimes this is caused by the fact that Magento caches some of the content (depends on your Magento Cache settings).

Usually Magento will warn you about expired cache and will suggest to clear cache.

cache warning

In any case you can always do this manually and this will refresh website look and make all your changes live.

Follow the steps below to clear Magento Cache:

  1. Go to administration panel > System > Tools > Cache Management

    cache management

  2. Click Flush Magento Cache

    flush cache


This will refresh all Magento Cache Types. Alternatively you can refresh some types of cache only by selecting them in the list of cache types, choose Refresh and Submit.

refresh cache

You can read more about how to clear Magento Cache in Magento DevDocs.

Installing Magento theme generated with Theme Factory is easy, just follow the steps below:

  1. Download your generated theme ZIP file

    download theme
  2. Unzip ZIP file to your magento root folder

    extract theme
    note: you can either unzip file locally and copy it to the server (for example with FTP) or copy zip file to your server and unzip it there with a command line or any other unzipping tool.
  3. Activate your theme in Magento administration panel. To do that go to Magento Admin panel > Content > Design > Configuration.

    content configuration
  4. Find your active Store view (or Store/Website, depending on your Magento setup) and click Edit

    edit design config
  5. Choose your new theme in Applied Theme dropdown and save your changes

    apply theme

That's all, you should now have your nice and shiny new look in Magento website.

Due to Magento architecture you might face some issues after applying new theme. If it does not work right away, here are few things to do next. See if your theme starts working after each steps, usually you don't have to complete all of them:

  1. Clear Magento Cache
  2. Clear Static Content
  3. Regenerate Static Content