Where Are My Files?

Contents

With the Webvanta system, much of your content is stored in the database, so there's not the same sort of literal mapping to the file system that you're probably accustomed to for each piece of your site. For example, a template, or a page, is a structure in the database, and not a file on disk (other than when it is cached to improve performance).

Your uploaded documents, such as images, pdf files, and standard JavaScript or CSS files, are regular files and are stored at the root of your site if you don't specify otherwise. If you simply upload a file "picture.jpg", you would access it your code as:

<img src="/picture.jpg">

In the Files control panel, you can easily create folders (directories) and upload files into those folders. If you had picture.jpg in a folder called images, for example, you'd reference it as:

<img src="/images/picture.jpg">

Note that it is important to put a slash at the start of the name. This applies for all references to any kind of file: image, pdf, css, JS, whatever.

If you do not include the leading slash, then the path is relative to the location of the current page, so your images will work fine when you're on a top-level page but not if you're on a page that is in a subdirectory.

Other File Paths

There are two ways to work with CSS and JS files in Webvanta. You can use the editor in the control panel, via Structure > CSS Files and Structure > JS Files, or you can upload CSS or JS files as assets. In either case, the files appear at the root of the site, unless you explicitly upload files to a folder that you create.

For example, a CSS file that you edit through the control panel would be accessed as /stylesheet.css, as it would be if you uploaded it as a file without specifying a folder. But if you created a folder in the asset uploader called "styles", and then uploaded stylesheet.css to that folder, then the path would be /styles/stylesheet.css.

It is equally important that all other file references use the leading slash, including:

  • References to background images in CSS files
  • References to CSS and JS files in your page templates (or snippets)
  • References to PDF files or other uploaded assets

Shared Webvanta Files

Some standard library files are made available to all sites through the "magic" /webvanta directory. These files include the jQuery library and a number of its plugins, the Blueprint CSS library, and some basic icons. You cannot modify these files directly; if you want to change one, access it via your browser, save it, and upload it to your site. Then change the path that references the file so that it does not include /webvanta but accesses your own private version of the file that you just uploaded.

Sidebar: Caching Your Site

There is a transient set of files that you don't work with explicitly, but that dramatically improve the performance of your site, which we mention here for completeness. This is the server cache.

When a page is generated from the database, the request passes through the front-end web server to the application server, which in turn makes requests from the database server. The application server then processes the information from the database to create the page.

We work hard to make this process as quick as we can, but the reality is that many database-driven pages take longer to create than we'd like. So Webvanta has a comprehensive caching system that stores copies of every page delivered. The second time the same page is requested, Webvanta's front-end server recognizes that it already has a snapshot of that page on disk, and it delivers the cached page without making any request to the application server or the database. These cached accesses are just as fast as an equivalent static page.

When you're working on a site, you'll frequently see slower accesses because Webvanta must purge the cache when you change the database. But once you stop modifying it, and the caches get filled up, most visitors will see fast performance.


Add Your Comments

(not published)