™ file are downloaded for each page. Use the following best practices to package your gadgets to meet this goal:
Building the gadget package
Use the following guidelines:
- When needed, compress static CSS files into one file per environment.
- Depending on the combination of CSS files needed per environment, group CSS files at run time, for example a third-party CSS file and your own gadget's CSS file.
- You can include other third-party components in your gadget package if they do not already exist in any of the supported environments.
- Your gadget code.
Each gadget may need an additional language package per language supported.
and CSS files at build time. However, if you support multiple environments and many languages, combining files at build time might not be the best option.
Packaging for better runtime performance
file. You can use a servlet or JavaServer Pages (JSP) file to combine multiple files into one URL.
and CSS file combiner servlet or JSP targets to combine relevant packages. For example, the CSS file might contain the following components:
- Third-party CSS
- Your gadget's CSS style
- Extensions to your gadget's CSS style
file might contain the following components:
- Configuration details
- National language support
files, you can build and deploy all the needed components together with your gadget.
You can also use a greatest common denominator
servlet target to combine files. This allows your gadget to work in a generic environment, although this environment may not have the best performance characteristics.
Parent topic: Best practices for developing gadgets and widgets