Knowledgebase

Managing Frontend Assets Print

  • phplaravel, webhosting, php, caching, performance, guide, howto, solution
  • 0

Styles and scripts.

WHAT LARAVEL PROVIDES

A build tool configuration for compiling styles and scripts.

WHAT IT DOES

Compiles and bundles Adds a version to filenames Produces optimised output for production

WHY VERSIONED FILENAMES MATTER

Browsers cache assets aggressively.

Without a version, a change is not seen.

THAT POINT

The reason a style change appears not to take effect.

WHAT TO RUN BEFORE DEPLOYING

The production build.

WHAT TO DEPLOY

The compiled output, not the source.

WHAT TO COMMIT

Source files and configuration.

WHAT TO DECIDE

Whether compiled output is committed or built during deployment.

WHAT SUITS SHARED HOSTING

Building locally and deploying the output.

WHY

Build tools require facilities frequently unavailable on shared hosting.

WHAT TO SERVE THROUGH THE WEB SERVER

All static assets, never through PHP.

WHAT TO CHECK AFTER DEPLOYMENT

That styles and scripts load, and that the versions are current.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot