Drupal 8 缓存 css 和 js

Drupal 8 cache css and js

我在自己的 vagrant box ( ubuntu ) 上新安装了 drupal 8。

一切正常,除了当我启用缓存时,css 文件没有正确加载。我认为由于权限问题无法设置缓存,但我需要一些帮助。

在未启用缓存的情况下(这是有效的)它正在加载以下文件:

@import url("http://local.startup.com/core/assets/vendor/normalize-css/normalize.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/system/components/ajax-progress.module.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/system/components/align.module.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/system/components/autocomplete-loading.module.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/system/components/fieldgroup.module.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/system/components/container-inline.module.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/system/components/clearfix.module.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/system/components/details.module.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/system/components/hidden.module.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/system/components/item-list.module.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/system/components/js.module.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/system/components/nowrap.module.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/system/components/position-container.module.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/system/components/progress.module.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/system/components/reset-appearance.module.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/system/components/resize.module.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/system/components/sticky-header.module.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/system/components/tabledrag.module.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/system/components/tablesort.module.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/system/components/tree-child.module.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/contextual/contextual.module.css?o1cpjr");
@import url("http://local.startup.com/core/assets/vendor/jquery.ui/themes/base/core.css?o1cpjr");
@import url("http://local.startup.com/core/assets/vendor/jquery.ui/themes/base/button.css?o1cpjr");
@import url("http://local.startup.com/core/assets/vendor/jquery.ui/themes/base/resizable.css?o1cpjr");
@import url("http://local.startup.com/core/assets/vendor/jquery.ui/themes/base/dialog.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/quickedit/quickedit.module.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/views/views.module.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/toolbar/toolbar.module.css?o1cpjr");
</style>
<style media="screen">
@import url("http://local.startup.com/core/themes/stable/css/tour/tour.module.css?o1cpjr");
</style>
<style media="all">
@import url("http://local.startup.com/core/themes/stable/css/contextual/contextual.toolbar.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/toolbar/toolbar.menu.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/contextual/contextual.theme.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/contextual/contextual.icons.theme.css?o1cpjr");
@import url("http://local.startup.com/core/assets/vendor/jquery.ui/themes/base/theme.css?o1cpjr");
@import url("http://local.startup.com/core/themes/seven/css/components/quickedit.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/quickedit/quickedit.theme.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/quickedit/quickedit.icons.theme.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/toolbar/toolbar.theme.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/toolbar/toolbar.icons.theme.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/user/user.icons.admin.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/shortcut/shortcut.theme.css?o1cpjr");
@import url("http://local.startup.com/core/themes/stable/css/shortcut/shortcut.icons.theme.css?o1cpjr");
</style>
<style media="all">
@import url("http://local.startup.com/core/themes/bartik/css/base/elements.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/layout.css?o1cpjr");
@import url("http://local.startup.com/core/themes/classy/css/components/dialog.css?o1cpjr");
@import url("http://local.startup.com/core/themes/classy/css/components/action-links.css?o1cpjr");
@import url("http://local.startup.com/core/themes/classy/css/components/breadcrumb.css?o1cpjr");
@import url("http://local.startup.com/core/themes/classy/css/components/button.css?o1cpjr");
@import url("http://local.startup.com/core/themes/classy/css/components/collapse-processed.css?o1cpjr");
@import url("http://local.startup.com/core/themes/classy/css/components/container-inline.css?o1cpjr");
@import url("http://local.startup.com/core/themes/classy/css/components/details.css?o1cpjr");
@import url("http://local.startup.com/core/themes/classy/css/components/exposed-filters.css?o1cpjr");
@import url("http://local.startup.com/core/themes/classy/css/components/field.css?o1cpjr");
@import url("http://local.startup.com/core/themes/classy/css/components/form.css?o1cpjr");
@import url("http://local.startup.com/core/themes/classy/css/components/icons.css?o1cpjr");
@import url("http://local.startup.com/core/themes/classy/css/components/inline-form.css?o1cpjr");
@import url("http://local.startup.com/core/themes/classy/css/components/item-list.css?o1cpjr");
@import url("http://local.startup.com/core/themes/classy/css/components/link.css?o1cpjr");
@import url("http://local.startup.com/core/themes/classy/css/components/links.css?o1cpjr");
@import url("http://local.startup.com/core/themes/classy/css/components/menu.css?o1cpjr");
@import url("http://local.startup.com/core/themes/classy/css/components/more-link.css?o1cpjr");
@import url("http://local.startup.com/core/themes/classy/css/components/pager.css?o1cpjr");
@import url("http://local.startup.com/core/themes/classy/css/components/tabledrag.css?o1cpjr");
@import url("http://local.startup.com/core/themes/classy/css/components/tableselect.css?o1cpjr");
@import url("http://local.startup.com/core/themes/classy/css/components/tablesort.css?o1cpjr");
@import url("http://local.startup.com/core/themes/classy/css/components/tabs.css?o1cpjr");
@import url("http://local.startup.com/core/themes/classy/css/components/textarea.css?o1cpjr");
@import url("http://local.startup.com/core/themes/classy/css/components/ui-dialog.css?o1cpjr");
@import url("http://local.startup.com/core/themes/classy/css/components/messages.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/block.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/book.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/breadcrumb.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/captions.css?o1cpjr");
</style>
<style media="all">
@import url("http://local.startup.com/core/themes/bartik/css/components/comments.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/contextual.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/demo-block.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/dropbutton.component.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/featured-top.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/feed-icon.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/field.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/form.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/forum.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/header.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/help.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/highlighted.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/item-list.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/list-group.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/list.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/main-content.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/menu.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/messages.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/node.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/node-preview.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/page-title.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/pager.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/panel.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/primary-menu.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/search-form.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/search-results.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/secondary-menu.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/shortcut.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/skip-link.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/sidebar.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/site-branding.css?o1cpjr");
</style>
<style media="all">
@import url("http://local.startup.com/core/themes/bartik/css/components/site-footer.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/table.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/tablesort-indicator.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/tabs.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/toolbar.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/featured-bottom.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/password-suggestions.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/ui.widget.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/vertical-tabs.component.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/views.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/buttons.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/image-button.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/components/ui-dialog.css?o1cpjr");
@import url("http://local.startup.com/core/themes/bartik/css/colors.css?o1cpjr");
</style>
<style media="print">
@import url("http://local.startup.com/core/themes/bartik/css/print.css?o1cpjr");
</style>

很多文件。

启用缓存后,它正在加载以下所有已编译的文件,但这不起作用。启用聚合 CSS 文件和聚合 JS 文件选项。

<link rel="stylesheet" href="http://local.startup.com/?o1cpjr" media="all" />
<link rel="stylesheet" href="http://local.startup.com/?o1cpjr" media="screen" />
<link rel="stylesheet" href="http://local.startup.com/?o1cpjr" media="all" />
<link rel="stylesheet" href="http://local.startup.com/?o1cpjr" media="all" />
<link rel="stylesheet" href="http://local.startup.com/?o1cpjr" media="print" />

知道为什么 css/js 文件的缓存不起作用吗?谢谢

转到配置 > 文件系统

并且临时目录下全部删除只留下php。在此之后不要忘记删除缓存:)