Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Minor wordsmithing

...

Assets are exposed to your code as instances of the Asset interface.

Injecting Assets

...

Assets are expected to be entirely static (not changing while the application is deployed). This allows Tapestry to perform some important performance optimizations.

Tapestry GZIP compresses the content of all assets – if the asset is compressible, the client supports it, and you don't explicitly disable it.

When Tapestry generates a URL for an asset, either on the classpath or from the context, the URL includes a the application version number. Further, the asset will get a far future expires header, which will encourage the client browser to cache the asset.

In addition, Tapestry will GZIP compress the content of all assets (if the asset is compressible, and the client supports it).

You should have an explicit application version number for any production application. Client browsers will aggressively cache downloaded assets; they will usually not even send a request to see if the asset has changed once the asset is downloaded the first time. Because of this it is very important that each new deployment of your application has a new version number (tapestry.application-version|Configuration]: this will , to force existing clients to re-download all filesassets.

Asset Security

Because Tapestry directly exposes files on the classpath to the clients, some thought has gone into ensuring that malicious clients are not able to download assets that should not be visible to them.

...